add database reset flag
This commit is contained in:
parent
bf34abf5f8
commit
3aeda54404
2 changed files with 18 additions and 7 deletions
8
main.go
8
main.go
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue