diff --git a/config.yaml.example b/config.yaml.example index 81b1bc7..36ab435 100644 --- a/config.yaml.example +++ b/config.yaml.example @@ -4,6 +4,7 @@ redis_url: redis://redis:6379 relay_bind: 0.0.0.0:8080 relay_domain: relay.toot.yukimochi.jp relay_servicename: YUKIMOCHI Toot Relay Service +job_concurrency: 50 # relay_summary: | # relay_icon: https:// diff --git a/readme.md b/readme.md index e31275e..598f452 100644 --- a/readme.md +++ b/readme.md @@ -33,6 +33,7 @@ redis_url: redis://redis:6379 relay_bind: 0.0.0.0:8080 relay_domain: relay.toot.yukimochi.jp relay_servicename: YUKIMOCHI Toot Relay Service +job_concurrency: 50 # relay_summary: | # relay_icon: https:// @@ -48,6 +49,7 @@ relay_servicename: YUKIMOCHI Toot Relay Service - `RELAY_BIND` (ex. `0.0.0.0:8080`) - `RELAY_DOMAIN` (ex. `relay.toot.yukimochi.jp`) - `RELAY_SERVICENAME` (ex. `YUKIMOCHI Toot Relay Service`) + - `JOB_CONCURRENCY` (ex. `50`) ## License [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fyukimochi%2FActivity-Relay.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fyukimochi%2FActivity-Relay?ref=badge_large) \ No newline at end of file diff --git a/worker/worker.go b/worker/worker.go index 7bc8282..95c1f6e 100644 --- a/worker/worker.go +++ b/worker/worker.go @@ -63,6 +63,7 @@ func initConfig() { viper.BindEnv("relay_bind") viper.BindEnv("relay_domain") viper.BindEnv("relay_servicename") + viper.BindEnv("job_concurrency") } else { Actor.Summary = viper.GetString("relay_summary") Actor.Icon = activitypub.Image{URL: viper.GetString("relay_icon")} @@ -112,7 +113,7 @@ func main() { } workerID := uuid.NewV4() - worker := machineryServer.NewWorker(workerID.String(), 20) + worker := machineryServer.NewWorker(workerID.String(), viper.GetInt("job_concurrency")) err = worker.Launch() if err != nil { fmt.Fprintln(os.Stderr, err)