Skip to content

Commit

Permalink
go/worker/storage: Disable storage worker when no runtimes configured
Browse files Browse the repository at this point in the history
  • Loading branch information
kostko committed Oct 11, 2023
1 parent f83b69d commit 3edf6f3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
1 change: 1 addition & 0 deletions .changelog/5394.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
go/worker/storage: Disable storage worker when no runtimes configured
2 changes: 1 addition & 1 deletion go/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (m NodeMode) IsClientOnly() bool {
// HasLocalStorage returns true iff the mode is one that has local storage.
func (m NodeMode) HasLocalStorage() bool {
switch m {
case ModeClient, ModeCompute:
case ModeClient, ModeCompute, ModeArchive:
return true
}
return false
Expand Down
5 changes: 1 addition & 4 deletions go/worker/storage/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@ func New(
commonWorker *workerCommon.Worker,
registration *registration.Worker,
) (*Worker, error) {
enabled := config.GlobalConfig.Mode.HasLocalStorage()
if config.GlobalConfig.Mode == config.ModeArchive && len(commonWorker.GetRuntimes()) > 0 {
enabled = true
}
enabled := config.GlobalConfig.Mode.HasLocalStorage() && len(commonWorker.GetRuntimes()) > 0

s := &Worker{
enabled: enabled,
Expand Down

0 comments on commit 3edf6f3

Please sign in to comment.