mirror of
https://github.com/containers/podman.git
synced 2025-05-21 09:05:56 +08:00
sqlite: AddContainerExitCode: allow to replace
Allow to replace existing exit codes. A container may be started and stopped multiple times etc. Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
This commit is contained in:
@ -855,7 +855,7 @@ func (s *SQLiteState) AddContainerExitCode(id string, exitCode int32) (defErr er
|
|||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
if _, err := tx.Exec("INSERT INTO ContainerExitCode VALUES (?, ?, ?);", id, time.Now().Unix(), exitCode); err != nil {
|
if _, err := tx.Exec("INSERT OR REPLACE INTO ContainerExitCode VALUES (?, ?, ?);", id, time.Now().Unix(), exitCode); err != nil {
|
||||||
return fmt.Errorf("adding container %s exit code %d: %w", id, exitCode, err)
|
return fmt.Errorf("adding container %s exit code %d: %w", id, exitCode, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user