diff options
| author | xengineering <me@xengineering.eu> | 2023-04-01 21:18:29 +0200 | 
|---|---|---|
| committer | xengineering <me@xengineering.eu> | 2023-04-02 21:52:10 +0200 | 
| commit | bae6e34c9119750b2cba2a2ce6d88e9f8c895900 (patch) | |
| tree | c171db86da17301c1fec735e1f10f4e9d91f1b41 /main.go | |
| parent | 996725cb4735e1026bb3409d52b5a61bc8274fd2 (diff) | |
| download | ceres-bae6e34c9119750b2cba2a2ce6d88e9f8c895900.tar ceres-bae6e34c9119750b2cba2a2ce6d88e9f8c895900.tar.zst ceres-bae6e34c9119750b2cba2a2ce6d88e9f8c895900.zip  | |
Switch from MariaDB to files
Using a database is way more complex (see the commit statistics of this
commit) than using files to store recipe data. Also administration and
usage is simpler.
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 19 | 
1 files changed, 0 insertions, 19 deletions
@@ -1,35 +1,16 @@  package main  import ( -	"database/sql"  	"log" -	"os" -	"os/signal" -	"syscall"  	"text/template"  )  var config RuntimeConfig -var db *sql.DB  var templates *template.Template  func main() {  	log.Printf("Started Ceres recipe server.\n")  	config = GetRuntimeConfig()  	templates = setupTemplates() -	db = setupDatabase() -	provideShutdown()  	runServer()  } - -func provideShutdown() { -	var listener = make(chan os.Signal) -	signal.Notify(listener, syscall.SIGTERM) -	signal.Notify(listener, syscall.SIGINT) -	go func() { -		signal := <-listener -		log.Printf("Got signal '%+v'. Shutdown is started.\n", signal) -		dbCleanup(db) -		os.Exit(0) -	}() -}  | 
