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

View file

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

View file

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

View file

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