aboutsummaryrefslogtreecommitdiff
path: root/cmd/server
diff options
context:
space:
mode:
authorGabriel Arakaki Giovanini <mail@gabrielgio.me>2023-06-24 00:00:00 +0200
committerGabriel Arakaki Giovanini <mail@gabrielgio.me>2023-06-24 00:00:00 +0200
commit1d6fa60b3c60d068d12b19f10f5ad73e836b5a70 (patch)
treea30afce205084ddccb2a3ca717b8458b48b02e4a /cmd/server
parentcff5600c8abebd1ce988b2185c07e998c4a1d483 (diff)
downloadlens-1d6fa60b3c60d068d12b19f10f5ad73e836b5a70.tar.gz
lens-1d6fa60b3c60d068d12b19f10f5ad73e836b5a70.tar.bz2
lens-1d6fa60b3c60d068d12b19f10f5ad73e836b5a70.zip
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.
Diffstat (limited to 'cmd/server')
-rw-r--r--cmd/server/main.go11
1 files changed, 6 insertions, 5 deletions
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 (