-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
34 lines (28 loc) · 799 Bytes
/
main.go
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
package main
import (
"github.com/alecthomas/kong"
"github.com/rs/zerolog/log"
"github.com/eriq-augustine/comic-server/config"
"github.com/eriq-augustine/comic-server/database"
"github.com/eriq-augustine/comic-server/metadata"
)
var args struct {
config.ConfigArgs
}
func main() {
kong.Parse(&args);
err := config.HandleConfigArgs(args.ConfigArgs);
if (err != nil) {
log.Fatal().Err(err).Msg("Could not load config options.");
}
err = database.Open();
if (err != nil) {
log.Fatal().Err(err).Msg("Could not open database.");
}
defer database.Close();
// TODO(eriq): Setup as background job.
err = metadata.ProcessCrawlRequests();
if (err != nil) {
log.Fatal().Err(err).Msg("Failed to crawl.");
}
}