blob: feb4f4b472b3f86f60b531d4ac9215c19d61cd73 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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)
}
|