From d64743162f703d7f42425278a7f5a12a68c84c56 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Mon, 22 Jul 2024 01:28:18 +0800 Subject: [PATCH] :sparkles: Support multiple notification push workers --- pkg/main.go | 4 +++- settings.toml | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/main.go b/pkg/main.go index fb208e2..d79b80d 100644 --- a/pkg/main.go +++ b/pkg/main.go @@ -42,7 +42,9 @@ func main() { } // Set up tasks queue consumers - go services.ConsumeDeliveryTasks() + for idx := 0; idx < max(1, viper.GetInt("performance.notification_deliver.worker_count")); idx++ { + go services.ConsumeDeliveryTasks() + } // Server go server.NewServer().Listen() diff --git a/settings.toml b/settings.toml index 8bc7901..fefff9f 100644 --- a/settings.toml +++ b/settings.toml @@ -16,6 +16,9 @@ firebase_credentials = "" use_registration_magic_token = false +[performance] +notification_deliver.worker_count = 4 + [dealer] addr = "127.0.0.1:8442"