Skip to content
This repository has been archived by the owner on May 9, 2024. It is now read-only.

Add "capacity" setting to limit the number of concurrent sessions #3

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/enduro-am-worker/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func main() {
workerOpts := temporalsdk_worker.Options{
DisableWorkflowWorker: true,
EnableSessionWorker: true,
MaxConcurrentSessionExecutionSize: 1000,
MaxConcurrentSessionExecutionSize: cfg.Capacity,
MaxConcurrentActivityExecutionSize: 1,
}
w := temporalsdk_worker.New(temporalClient, AmWorkerTaskQueue, workerOpts)
Expand Down
1 change: 1 addition & 0 deletions enduro.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ debug = true
debugListen = "127.0.0.1:9001"
verbosity = 2
useArchivematica = true
capacity = 1

[temporal]
namespace = "default"
Expand Down
2 changes: 2 additions & 0 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ type Configuration struct {
Debug bool
DebugListen string
UseArchivematica bool
Capacity int
API api.Config
Event event.Config
Database db.Config
Expand Down Expand Up @@ -67,6 +68,7 @@ func Read(config *Configuration, configFile string) (found bool, configFileUsed
v.SetDefault("api.processing", a3m.ProcessingDefault)
v.SetDefault("debugListen", "127.0.0.1:9001")
v.SetDefault("api.listen", "127.0.0.1:9000")
v.SetDefault("capacity", "1")
v.SetEnvPrefix("enduro")
v.SetEnvKeyReplacer(strings.NewReplacer(".", "_"))
v.AutomaticEnv()
Expand Down
Loading