Compare commits
2 commits
6124a4097b
...
d2f6c3cd66
Author | SHA1 | Date | |
---|---|---|---|
d2f6c3cd66 | |||
13c9c544a7 |
3 changed files with 13 additions and 13 deletions
4
Cargo.lock
generated
4
Cargo.lock
generated
|
@ -185,9 +185,9 @@ checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b"
|
|||
|
||||
[[package]]
|
||||
name = "cc"
|
||||
version = "1.2.10"
|
||||
version = "1.2.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "13208fcbb66eaeffe09b99fffbe1af420f00a7b35aa99ad683dfc1aa76145229"
|
||||
checksum = "e4730490333d58093109dc02c23174c3f4d490998c3fed3cc8e82d57afedb9cf"
|
||||
dependencies = [
|
||||
"shlex",
|
||||
]
|
||||
|
|
6
flake.lock
generated
6
flake.lock
generated
|
@ -37,11 +37,11 @@
|
|||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1738021509,
|
||||
"narHash": "sha256-JNUiceGsr7cVBUQxLBF1ILCe99E0qLxsVuet6GsZUuw=",
|
||||
"lastModified": 1738142207,
|
||||
"narHash": "sha256-NGqpVVxNAHwIicXpgaVqJEJWeyqzoQJ9oc8lnK9+WC4=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "9db269672dbdbb519e0bd3ea24f01506c135e46f",
|
||||
"rev": "9d3ae807ebd2981d593cddd0080856873139aa40",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
16
src/main.rs
16
src/main.rs
|
@ -517,20 +517,20 @@ async fn update_records(
|
|||
|
||||
if let Some(ip) = ipv4 {
|
||||
let ip = IpAddr::V4(ip);
|
||||
if !state.ip_type.valid_for_type(ip) {
|
||||
if state.ip_type.valid_for_type(ip) {
|
||||
_ = trigger_update(ip, &state).await?;
|
||||
} else {
|
||||
tracing::warn!("requested update of IPv4 but we are {}", state.ip_type);
|
||||
}
|
||||
|
||||
_ = trigger_update(ip, &state).await?;
|
||||
}
|
||||
|
||||
if let Some(ip) = ipv6 {
|
||||
let ip = IpAddr::V6(ip);
|
||||
if !state.ip_type.valid_for_type(ip) {
|
||||
if state.ip_type.valid_for_type(ip) {
|
||||
_ = trigger_update(ip, &state).await?;
|
||||
} else {
|
||||
tracing::warn!("requested update of IPv6 but we are {}", state.ip_type);
|
||||
}
|
||||
|
||||
_ = trigger_update(ip, &state).await?;
|
||||
}
|
||||
|
||||
Ok("Successfully updated IP of records!\n")
|
||||
|
@ -566,13 +566,13 @@ async fn trigger_update(
|
|||
error!("nsupdate failed with code {status}");
|
||||
Err((
|
||||
StatusCode::INTERNAL_SERVER_ERROR,
|
||||
"nsupdate failed, check server logs",
|
||||
"nsupdate failed, check server logs\n",
|
||||
)
|
||||
.into())
|
||||
}
|
||||
Err(error) => Err((
|
||||
StatusCode::INTERNAL_SERVER_ERROR,
|
||||
format!("failed to update records: {error}"),
|
||||
format!("failed to update records: {error}\n"),
|
||||
)
|
||||
.into()),
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue