add database reset flag

This commit is contained in:
Samuel Lorch 2024-05-11 00:38:40 +02:00
parent bf34abf5f8
commit 3aeda54404
2 changed files with 18 additions and 7 deletions

View file

@ -25,7 +25,9 @@ var migrations embed.FS
var conf config.Config
func main() {
isserver := flag.Bool("server", false, "Run as Server")
isServer := flag.Bool("server", false, "Run as Server")
resetDB := flag.Bool("reset-db", false, "Reset DB")
flag.Parse()
confPath := "config.toml"
_, err := os.Stat(confPath)
@ -48,9 +50,9 @@ func main() {
conf.Worker.TempDir = "/tmp"
}
if *isserver {
if *isServer {
slog.Info("Starting Server...")
server.Start(conf, templates, static, migrations)
server.Start(conf, templates, static, migrations, *resetDB)
} else {
slog.Info("Starting Worker...")
worker.Start(conf)