Skip to content

Commit

Permalink
UPLOAD-1388: Default to tusd in-memory locker, if Redis is not availa…
Browse files Browse the repository at this point in the history
…ble at startup (#394)

* Update to not fail startup if no Redis

* Improve error messaging
  • Loading branch information
dtisza1 authored and cfarmer-fearless committed Jun 18, 2024
1 parent d2b874b commit 7322b31
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions upload-server/cmd/cli/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,16 @@ func Serve(appConfig appconfig.AppConfig) (http.Handler, error) {
var err error
locker, err = redislocker.New(appConfig.TusRedisLockURI, redislocker.WithLogger(logger))
if err != nil {
logger.Error("error configuring redis locker", "error", err)
return nil, err
logger.Error("failed to configure Redis locker, defaulting to in-memory locker", "error", err)
}
// redislocker health check

// configure redislocker health check
redisLockerHealth, err := redislockerhealth.New(appConfig.TusRedisLockURI)
if err != nil {
logger.Error("error configuring redis locker health check: ", "error", err)
return nil, err
logger.Error("failed to configure Redis locker health check, skipping check", "error", err)
} else {
health.Register(redisLockerHealth)
}

health.Register(redisLockerHealth)
}

// get and initialize tusd hook handlers
Expand Down

0 comments on commit 7322b31

Please sign in to comment.