mirror of
https://github.com/GrassrootsEconomics/cic-dw.git
synced 2024-12-22 19:07:33 +01:00
Mohammed Sohail
1c65a11460
- no repeat on failure, picked up on next schedule - enforce uniq on users and tx table to prevent duplicates
25 lines
493 B
Go
25 lines
493 B
Go
package main
|
|
|
|
import (
|
|
"github.com/hibiken/asynq"
|
|
"github.com/rs/zerolog/log"
|
|
)
|
|
|
|
func runProcessor(app *App) {
|
|
processorServer := asynq.NewServer(
|
|
app.rClient,
|
|
asynq.Config{
|
|
Concurrency: 10,
|
|
},
|
|
)
|
|
|
|
mux := asynq.NewServeMux()
|
|
mux.Handle("token:sync", newTokenSyncer(app))
|
|
mux.Handle("cache:sync", newCacheSyncer(app))
|
|
mux.Handle("ussd:sync", newUssdSyncer(app))
|
|
|
|
if err := processorServer.Run(mux); err != nil {
|
|
log.Fatal().Err(err).Msg("failed to start job processor")
|
|
}
|
|
}
|