Refactoring #34

Merged
bendodroid merged 10 commits from :Bendodroid-refactoring into main 2024-05-26 21:06:30 +02:00
4 changed files with 6 additions and 6 deletions
Showing only changes of commit 72f5a67989 - Show all commits

View file

@ -12,8 +12,8 @@ import (
"git.hamburg.ccc.de/ccchh/spaceapid/config"
"git.hamburg.ccc.de/ccchh/spaceapid/handlers"
"git.hamburg.ccc.de/ccchh/spaceapid/persistence"
"git.hamburg.ccc.de/ccchh/spaceapid/types"
"git.hamburg.ccc.de/ccchh/spaceapid/util"
)
var (
@ -39,7 +39,7 @@ func main() {
conf := config.ParseConfiguration()
// Merge old state if present
util.MergeOldState(&conf.Response)
persistence.MergeOldState(&conf.Response)
// Register signal handler
sc := make(chan os.Signal, 1)
@ -47,7 +47,7 @@ func main() {
go func(resp *types.SpaceAPIResponseV14) {
<-sc
log.Println("Saving state and shutting down...")
util.SaveCurrentState(*resp)
persistence.SaveCurrentState(*resp)
os.Exit(0)
}(&conf.Response)

View file

@ -1,4 +1,4 @@
package util
package persistence
import (
"encoding/json"

View file

@ -1,6 +1,6 @@
//go:build !linux
package util
package persistence
const (
persistentStateDir = "./"

View file

@ -1,4 +1,4 @@
package util
package persistence
const (
persistentStateDir = "/var/lib/spaceapid/"