mirror of
https://github.com/nicotsx/zerobyte.git
synced 2025-12-10 12:10:51 +01:00
feat: sse for volume status change
This commit is contained in:
@@ -224,6 +224,10 @@ const checkHealth = async (name: string) => {
|
||||
const backend = createVolumeBackend(volume);
|
||||
const { error, status } = await backend.checkHealth();
|
||||
|
||||
if (status !== volume.status) {
|
||||
serverEvents.emit("volume:status_changed", { volumeName: name, status });
|
||||
}
|
||||
|
||||
await db
|
||||
.update(volumesTable)
|
||||
.set({ lastHealthCheck: Date.now(), status, lastError: error ?? null })
|
||||
|
||||
Reference in New Issue
Block a user