Skip to content

Commit

Permalink
Don't let the server start if we're rebooting
Browse files Browse the repository at this point in the history
  • Loading branch information
lukechilds committed Mar 21, 2024
1 parent 8b5574f commit 07c6629
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/umbreld/source/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ export default class Umbreld {
await commitOsPartition(this)
await fse.writeFile(justDidRebootFile, cmdline)
await reboot()
return true
} catch (error) {
this.logger.error(`Failed to blacklist UAS driver: ${(error as Error).message}`)
}
Expand All @@ -185,7 +186,8 @@ export default class Umbreld {
this.setupPiCpuGoverner()

// Blacklist UAS driver for Raspberry Pi 4
await this.blacklistUASDriver()
const isRebooting = await this.blacklistUASDriver()
if (isRebooting === true) return // Don't let the server start if we're rebooting

// Run migration module before anything else
// TODO: think through if we want to allow the server module to run before migration.
Expand Down

0 comments on commit 07c6629

Please sign in to comment.