summaryrefslogtreecommitdiffci
diff options
from:
to:
context:
space:
mode:
-rw-r--r--config/config.local.yaml2
-rw-r--r--config/config.prod.yaml2
-rw-r--r--config/config.stage.yaml2
-rw-r--r--internal/blogtrigger/blogtrigger.go4
-rw-r--r--internal/router/lang-user-unsubscribe.go2
-rw-r--r--main.go3
6 files changed, 11 insertions, 4 deletions
diff --git a/config/config.local.yaml b/config/config.local.yaml
index d40e8e9..327bad4 100644
--- a/config/config.local.yaml
+++ b/config/config.local.yaml
@@ -32,7 +32,7 @@ auth:
db:
type: sqlite3
config:
- dsn: 'file:/tmp/auth.db?cache=shared&mode=rwc'
+ dsn: 'file:/tmp/auth.db?cache=shared&mode=rwc&_journal_mode=WAL'
salt: '123'
mail:
clientHost: '127.0.0.1:3000'
diff --git a/config/config.prod.yaml b/config/config.prod.yaml
index 7a9e5ae..0bee79d 100644
--- a/config/config.prod.yaml
+++ b/config/config.prod.yaml
@@ -32,7 +32,7 @@ auth:
db:
type: sqlite3
config:
- dsn: 'file:/data/auth.db?cache=private&mode=rwc&_locking_mode=EXCLUSIVE&_mutex=no&_auto_vacuum=2'
+ dsn: 'file:/data/auth.db?cache=private&mode=rwc&_locking_mode=EXCLUSIVE&_mutex=no&_auto_vacuum=2&_journal_mode=WAL'
salt: '${AUTH_SALT}'
mail:
clientHost: '${FQDN}'
diff --git a/config/config.stage.yaml b/config/config.stage.yaml
index 8a5fde1..1c15dae 100644
--- a/config/config.stage.yaml
+++ b/config/config.stage.yaml
@@ -32,7 +32,7 @@ auth:
db:
type: sqlite3
config:
- dsn: 'file:/data/auth.db?cache=private&mode=rwc&_locking_mode=EXCLUSIVE&_mutex=no&_auto_vacuum=2'
+ dsn: 'file:/data/auth.db?cache=private&mode=rwc&_locking_mode=EXCLUSIVE&_mutex=no&_auto_vacuum=2&_journal_mode=WAL'
salt: '${AUTH_SALT}'
mail:
clientHost: '${FQDN}'
diff --git a/internal/blogtrigger/blogtrigger.go b/internal/blogtrigger/blogtrigger.go
index 9b016e8..c5b3097 100644
--- a/internal/blogtrigger/blogtrigger.go
+++ b/internal/blogtrigger/blogtrigger.go
@@ -49,6 +49,10 @@ func NewBlogTriggerScheduler(b2Client *b2.B2Client, availableLanguages []config.
return bts, nil
}
+func (bts *BlogTriggerScheduler) Close() error {
+ return bts.s.Shutdown()
+}
+
func (bts *BlogTriggerScheduler) scan() (newPages []*b2.BlogPage, err error) {
newPages = make([]*b2.BlogPage, 0)
for lang := range bts.knownBlogPages {
diff --git a/internal/router/lang-user-unsubscribe.go b/internal/router/lang-user-unsubscribe.go
index a6ca89f..81d1bfb 100644
--- a/internal/router/lang-user-unsubscribe.go
+++ b/internal/router/lang-user-unsubscribe.go
@@ -45,7 +45,7 @@ func Lang_User_Unsubscribe(l map[string]*locale.LocaleConfig, langs []config.Ava
statusText = l[lang].UnsubscribePage.OnServerError
status = fiber.ErrInternalServerError.Code
} else {
- statusColor = "0, 255, 0,"
+ statusColor = "0, 255, 0"
statusEmoji = "♡⸜(˶˃ ᵕ ˂˶)⸝♡"
statusText = l[lang].UnsubscribePage.Success
status = fiber.StatusOK
diff --git a/main.go b/main.go
index bd552a1..174854d 100644
--- a/main.go
+++ b/main.go
@@ -202,6 +202,9 @@ func main() {
<-sigChan
slog.Info("gracefully shutting down...")
+ if err = router.BlogTrigger.Close(); err != nil {
+ slog.Error("fail to shutdown blog trigger scheduler", slog.String("error", err.Error()))
+ }
if err = app.Shutdown(); err != nil {
slog.Error("fail to shutdown fiber server", slog.String("error", err.Error()))
}