mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-29 14:45:24 +00:00
fix: host imports running a defaults pass and metrics restart per host (#1384)
This commit is contained in:
1 parent
5e31642379
commit
11a22d30eb
6 files changed
+76
-10
No files matched your search
@@ -25,3 +25,22 @@ export async function applyDefaultsAfterHostWrite(
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The same for many hosts written in one go (an import), in a single pass
|
||||
* instead of one per host.
|
||||
*/
|
||||
export async function applyDefaultsAfterHostWrites(
|
||||
hostIds: number[],
|
||||
): Promise<void> {
|
||||
if (hostIds.length === 0) return;
|
||||
try {
|
||||
await recompute({ hostIds });
|
||||
} catch (error) {
|
||||
databaseLogger.warn("Could not apply host defaults after a write", {
|
||||
operation: "host_defaults_after_write",
|
||||
hosts: hostIds.length,
|
||||
error: error instanceof Error ? error.message : String(error),
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user