Skip to content

Commit

Permalink
Only check lockfile on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
dantecatalfamo committed Jan 28, 2025
1 parent b7dc482 commit 191feef
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions orbit/cmd/desktop/desktop.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,16 +111,18 @@ func main() {
log.Info().Msgf("got a TUF update root: %s", tufUpdateRoot)
}

// Ensure only one instance of Fleet Desktop is running at a time
lockFile, err := getLockfile()
if err != nil {
log.Fatal().Err(err).Msg("could not secure lock file")
}
defer func() {
if err := lockFile.Unlock(); err != nil {
log.Error().Err(err).Msg("unlocking lockfile")
if runtime.GOOS == "linux" {
// Ensure only one instance of Fleet Desktop is running at a time
lockFile, err := getLockfile()
if err != nil {
log.Fatal().Err(err).Msg("could not secure lock file")
}
}()
defer func() {
if err := lockFile.Unlock(); err != nil {
log.Error().Err(err).Msg("unlocking lockfile")
}
}()
}

// Setting up working runners such as signalHandler runner
go setupRunners()
Expand Down

0 comments on commit 191feef

Please sign in to comment.