Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit 10b8b63

Browse files
committed
live: Workaround for a weird stat error when deleting from Live nodes
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.
1 parent b542dc1 commit 10b8b63

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

live/main.go

+9
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"encoding/json"
1212
"errors"
1313
"fmt"
14+
"io/fs"
1415
"log"
1516
"os"
1617
"path/filepath"
@@ -436,6 +437,14 @@ func removeLiveDB(dbOwner, dbName string) (err error) {
436437
dbDir := filepath.Join(com.Conf.Live.StorageDir, dbOwner, dbName)
437438
dbPath := filepath.Join(dbDir, "live.sqlite")
438439
if _, err = os.Stat(dbPath); err != nil {
440+
if errors.Is(err, fs.ErrNotExist) {
441+
if com.AmqpDebug > 0 {
442+
log.Printf("Live node '%s': Database file '%s/%s' was requested to be deletet, but was missing " +
443+
"from filesystem path: '%s'", com.Conf.Live.Nodename, dbOwner, dbName, dbPath)
444+
}
445+
return
446+
}
447+
439448
// Something wrong with the database file
440449
log.Println(err)
441450
return

0 commit comments

Comments
 (0)