snapshot: Lock instances before making snapshot

This commit is contained in:
Tom Wiesing 2022-10-12 16:18:14 +02:00
parent f1c5d518c2
commit 5e7c5b2d23
No known key found for this signature in database
11 changed files with 167 additions and 0 deletions

View file

@ -70,6 +70,11 @@ func (wisski *WissKI) setLastRebuild() error {
//
// It also logs the current time into the metadata belonging to this instance.
func (wisski *WissKI) Build(stream stream.IOStream, start bool) error {
if err := wisski.TryLock(); err != nil {
return err
}
defer wisski.Unlock()
barrel := wisski.Barrel()
var context component.InstallationContext