diff options
author | 2020-06-19 15:51:41 +0200 | |
---|---|---|
committer | 2020-06-19 15:51:41 +0200 | |
commit | 21181c518cf41828917d36005b726f9452fde657 (patch) | |
tree | 38fab1b3c86a41383e48be6b2686d92efd86db62 /archives.go | |
download | archives-21181c518cf41828917d36005b726f9452fde657.tar.gz archives-21181c518cf41828917d36005b726f9452fde657.tar.bz2 archives-21181c518cf41828917d36005b726f9452fde657.zip |
Initial version
Signed-off-by: Max Magorsch <arzano@gentoo.org>
Diffstat (limited to 'archives.go')
-rw-r--r-- | archives.go | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/archives.go b/archives.go new file mode 100644 index 0000000..feb4f4b --- /dev/null +++ b/archives.go @@ -0,0 +1,41 @@ +package main + +import ( + "archives/pkg/app" + "archives/pkg/database" + "archives/pkg/importer" + "flag" + "fmt" +) + +var flagvar int + +func main() { + + fmt.Println("Starting Gentoo Archives.") + + waitForPostgres() + database.Connect() + defer database.DBCon.Close() + + // main part + + fullImport := flag.Bool("fullimport", false, "Start a full import, importing all mails") + serve := flag.Bool("serve", false, "Start serving the web application") + flag.Parse() + + if *fullImport { + importer.FullImport() + } + + if *serve { + app.Serve() + } + +} + +// TODO this has to be solved differently +// wait for postgres to come up +func waitForPostgres() { + //time.Sleep(2 * time.Second) +} |