Use Job Concurrency.

This commit is contained in:
Naoki Kosaka 2020-12-22 21:59:50 +09:00
parent a2cc2b7781
commit 638a1e7319
3 changed files with 5 additions and 1 deletions

View File

@ -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://

View File

@ -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)

View File

@ -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)