From 1d6fa60b3c60d068d12b19f10f5ad73e836b5a70 Mon Sep 17 00:00:00 2001 From: Gabriel Arakaki Giovanini Date: Sat, 24 Jun 2023 00:00:00 +0200 Subject: feat: Add scheduler again Since I have fixed the issue with the `SIGTINT` hanging the application I can readd the scheduler once more. Also move the param for amount of scheduler work. --- cmd/server/main.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'cmd') diff --git a/cmd/server/main.go b/cmd/server/main.go index 0abdc09..8b1cc00 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -28,10 +28,11 @@ import ( func main() { var ( - key = flag.String("aes-key", "", "AES key, either 16, 24, or 32 bytes string to select AES-128, AES-192, or AES-256") - dbType = flag.String("db-type", "sqlite", "Database to be used. Choose either mysql, psql or sqlite") - dbCon = flag.String("db-con", "main.db", "Database string connection for given database type. Ref: https://gorm.io/docs/connecting_to_the_database.html") - logLevel = flag.String("log-level", "error", "Log level: Choose either trace, debug, info, warning, error, fatal or panic") + key = flag.String("aes-key", "", "AES key, either 16, 24, or 32 bytes string to select AES-128, AES-192, or AES-256") + dbType = flag.String("db-type", "sqlite", "Database to be used. Choose either mysql, psql or sqlite") + dbCon = flag.String("db-con", "main.db", "Database string connection for given database type. Ref: https://gorm.io/docs/connecting_to_the_database.html") + logLevel = flag.String("log-level", "error", "Log level: Choose either trace, debug, info, warning, error, fatal or panic") + schedulerCount = flag.Uint("scheduler-count", 10, "How many workers are created to process media files") // TODO: this will later be replaced by user specific root folder root = flag.String("root", "", "root folder for the whole application. All the workers will use it as working directory") @@ -79,7 +80,7 @@ func main() { extRouter.AddMiddleware(authMiddleware.LoggedIn) extRouter.AddMiddleware(ext.HTML) - scheduler := worker.NewScheduler(10) + scheduler := worker.NewScheduler(*schedulerCount) // repository var ( -- cgit v1.2.3