Skip to content

Commit

Permalink
live: Workaround for a weird stat error when deleting from Live nodes
Browse files Browse the repository at this point in the history
Addresses #203, which I've not been able to replicate
in testing (so far).

Lets keep the issue open for now though, for future
follow up.
  • Loading branch information
justinclift committed May 3, 2023
1 parent b542dc1 commit 10b8b63
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions live/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"encoding/json"
"errors"
"fmt"
"io/fs"
"log"
"os"
"path/filepath"
Expand Down Expand Up @@ -436,6 +437,14 @@ func removeLiveDB(dbOwner, dbName string) (err error) {
dbDir := filepath.Join(com.Conf.Live.StorageDir, dbOwner, dbName)
dbPath := filepath.Join(dbDir, "live.sqlite")
if _, err = os.Stat(dbPath); err != nil {
if errors.Is(err, fs.ErrNotExist) {
if com.AmqpDebug > 0 {
log.Printf("Live node '%s': Database file '%s/%s' was requested to be deletet, but was missing " +
"from filesystem path: '%s'", com.Conf.Live.Nodename, dbOwner, dbName, dbPath)
}
return
}

// Something wrong with the database file
log.Println(err)
return
Expand Down

0 comments on commit 10b8b63

Please sign in to comment.