Switch to SQLite for activity tracking

This commit is contained in:
DaneEveritt
2022-07-10 16:51:11 -04:00
parent e1e7916790
commit 7bd11c1c28
16 changed files with 269 additions and 745 deletions

View File

@@ -6,6 +6,7 @@ import (
"errors"
"fmt"
"github.com/pterodactyl/wings/internal/cron"
"github.com/pterodactyl/wings/internal/sqlite"
log2 "log"
"net/http"
_ "net/http/pprof"
@@ -131,6 +132,10 @@ func rootCmdRun(cmd *cobra.Command, _ []string) {
}),
)
if err := sqlite.Initialize(cmd.Context()); err != nil {
log.WithField("error", err).Fatal("failed to initialize database")
}
manager, err := server.NewManager(cmd.Context(), pclient)
if err != nil {
log.WithField("error", err).Fatal("failed to load server configurations")
@@ -260,7 +265,7 @@ func rootCmdRun(cmd *cobra.Command, _ []string) {
}
}()
if s, err := cron.Scheduler(manager); err != nil {
if s, err := cron.Scheduler(cmd.Context(), manager); err != nil {
log.WithField("error", err).Fatal("failed to initialize cron system")
} else {
log.WithField("subsystem", "cron").Info("starting cron processes")