[client] Add support for state manager on iOS (#2996)

This commit is contained in:
Pascal Fischer
2024-12-06 16:51:42 +01:00
committed by GitHub
parent ff330e644e
commit e40a29ba17
8 changed files with 130 additions and 15 deletions

View File

@ -243,6 +243,17 @@ func NewEngineWithProbes(
probes: probes,
checks: checks,
}
if runtime.GOOS == "ios" {
if !fileExists(mobileDep.StateFilePath) {
err := createFile(mobileDep.StateFilePath)
if err != nil {
log.Errorf("failed to create state file: %v", err)
// we are not exiting as we can run without the state manager
}
}
engine.stateManager = statemanager.New(mobileDep.StateFilePath)
}
if path := statemanager.GetDefaultStatePath(); path != "" {
engine.stateManager = statemanager.New(path)
}