summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmd/gotosocial/action/server/server.go6
-rw-r--r--internal/media/manager_test.go7
2 files changed, 10 insertions, 3 deletions
diff --git a/cmd/gotosocial/action/server/server.go b/cmd/gotosocial/action/server/server.go
index 5c1192b56..ae43995e5 100644
--- a/cmd/gotosocial/action/server/server.go
+++ b/cmd/gotosocial/action/server/server.go
@@ -24,9 +24,11 @@ import (
"net/http"
"os"
"os/signal"
+ "path"
"syscall"
"codeberg.org/gruf/go-store/kv"
+ "codeberg.org/gruf/go-store/storage"
"github.com/sirupsen/logrus"
"github.com/spf13/viper"
"github.com/superseriousbusiness/gotosocial/cmd/gotosocial/action"
@@ -99,7 +101,9 @@ var Start action.GTSAction = func(ctx context.Context) error {
// Open the storage backend
storageBasePath := viper.GetString(config.Keys.StorageLocalBasePath)
- storage, err := kv.OpenFile(storageBasePath, nil)
+ storage, err := kv.OpenFile(storageBasePath, &storage.DiskConfig{
+ LockFile: path.Join(storageBasePath, "store.lock"), // put the store lockfile in the storage dir itself
+ })
if err != nil {
return fmt.Errorf("error creating storage backend: %s", err)
}
diff --git a/internal/media/manager_test.go b/internal/media/manager_test.go
index caba1dd36..a9419754c 100644
--- a/internal/media/manager_test.go
+++ b/internal/media/manager_test.go
@@ -24,6 +24,7 @@ import (
"fmt"
"io"
"os"
+ "path"
"testing"
"time"
@@ -284,10 +285,12 @@ func (suite *ManagerTestSuite) TestSimpleJpegProcessBlockingWithDiskStorage() {
accountID := "01FS1X72SK9ZPW0J1QQ68BD264"
- temp := fmt.Sprintf("%s/store", os.TempDir())
+ temp := fmt.Sprintf("%s/gotosocial-test", os.TempDir())
defer os.RemoveAll(temp)
- diskStorage, err := kv.OpenFile(temp, &storage.DiskConfig{})
+ diskStorage, err := kv.OpenFile(temp, &storage.DiskConfig{
+ LockFile: path.Join(temp, "store.lock"),
+ })
if err != nil {
panic(err)
}