Remove options
This commit is contained in:
@@ -50,44 +50,26 @@ func MainApp(configPath string) {
|
||||
|
||||
premium.MonitorPremiumStatus(rd, zurglog)
|
||||
|
||||
workerOptions := ants.Options{
|
||||
// Nonblocking: true,
|
||||
PanicHandler: func(i interface{}) {},
|
||||
Logger: log.Named("worker"),
|
||||
}
|
||||
|
||||
workerPool, err := ants.NewPool(config.GetNumOfWorkers(), ants.WithOptions(workerOptions))
|
||||
workerPool, err := ants.NewPool(config.GetNumOfWorkers())
|
||||
if err != nil {
|
||||
zurglog.Errorf("Failed to create worker pool: %v", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
defer workerPool.Release()
|
||||
|
||||
refreshOptions := ants.Options{
|
||||
// Nonblocking: true,
|
||||
PanicHandler: func(i interface{}) {},
|
||||
Logger: log.Named("refreshworker"),
|
||||
}
|
||||
|
||||
// extra 1 worker for the refresh job
|
||||
refreshPool, err := ants.NewPool(1, ants.WithOptions(refreshOptions))
|
||||
refreshPool, err := ants.NewPool(1)
|
||||
if err != nil {
|
||||
zurglog.Errorf("Failed to create worker pool: %v", err)
|
||||
zurglog.Errorf("Failed to create refresh worker: %v", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
defer refreshPool.Release()
|
||||
|
||||
repairOptions := ants.Options{
|
||||
// Nonblocking: true,
|
||||
PanicHandler: func(i interface{}) {},
|
||||
Logger: log.Named("repairworker"),
|
||||
}
|
||||
|
||||
var repairPool *ants.Pool
|
||||
if config.EnableRepair() {
|
||||
repairPool, err = ants.NewPool(1, ants.WithOptions(repairOptions))
|
||||
repairPool, err = ants.NewPool(1)
|
||||
if err != nil {
|
||||
zurglog.Errorf("Failed to create repair pool: %v", err)
|
||||
zurglog.Errorf("Failed to create repair worker: %v", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
defer repairPool.Release()
|
||||
|
||||
Reference in New Issue
Block a user