Skip to content

Commit ef4556d

Browse files
committed
fix(avahi): bound restart time during rename flow
- add a 10 second timeout to the Avahi restart used after hostname changes - before this change, the rename flow could wait indefinitely if the rc.avahidaemon script hung - that was risky in onboarding because the user-facing reconnect path depends on this service refresh completing or failing predictably - now the restart is bounded, logs a useful error on failure, and still rethrows so the existing strict mutation failure behavior is preserved
1 parent 04eee60 commit ef4556d

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

api/src/unraid-api/avahi/avahi.service.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,14 @@ export class AvahiService {
77
private readonly logger = new Logger(AvahiService.name);
88

99
async restart(): Promise<void> {
10-
await execa('/etc/rc.d/rc.avahidaemon', ['restart']);
11-
this.logger.log('Avahi daemon restarted');
10+
try {
11+
await execa('/etc/rc.d/rc.avahidaemon', ['restart'], {
12+
timeout: 10_000,
13+
});
14+
this.logger.log('Avahi daemon restarted');
15+
} catch (error) {
16+
this.logger.error('Failed to restart Avahi daemon', error as Error);
17+
throw error;
18+
}
1219
}
1320
}

0 commit comments

Comments
 (0)