upd
This commit is contained in:
parent
ecc9b8a180
commit
5e25478137
1
cron.go
1
cron.go
@ -103,7 +103,6 @@ func cronSaveClients() {
|
||||
logOnError(err, "cronSaveClients : Marshal")
|
||||
|
||||
pb := pretty.Pretty(b)
|
||||
log.Printf("cronSaveClients :\n%s\n", string(pb))
|
||||
|
||||
err = ioutil.WriteFile("./clients_new.json", pb, 0644)
|
||||
logOnError(err, "cronSaveClients : WriteFile")
|
||||
|
18
main.go
18
main.go
@ -86,23 +86,7 @@ func main() {
|
||||
initDB()
|
||||
}
|
||||
|
||||
initCache()
|
||||
|
||||
if *initdb {
|
||||
_, _ = addObjCastle(`🦌`, `Deerhorn`)
|
||||
_, _ = addObjCastle(`🐉`, `Dragonscale`)
|
||||
_, _ = addObjCastle(`🦅`, `Highnest`)
|
||||
_, _ = addObjCastle(`🌑`, `Moonlight`)
|
||||
_, _ = addObjCastle(`🥔`, `Potato`)
|
||||
_, _ = addObjCastle(`🦈`, `Sharkteeth`)
|
||||
_, _ = addObjCastle(`🐺`, `Wolfpack`)
|
||||
_, _ = addObjCastle(`⛔`, `Unknown`)
|
||||
_, _ = addObjGuild(``, `No Guild`)
|
||||
}
|
||||
|
||||
log.Println("Caching castles ..")
|
||||
err = loadObjCastle()
|
||||
logOnError(err, "initCache : caching castles")
|
||||
initCache(*initdb)
|
||||
|
||||
// Registering bot
|
||||
bot, err := tb.NewBot(tb.Settings{
|
||||
|
25
obj.go
25
obj.go
@ -30,7 +30,7 @@ var (
|
||||
muxObjJob sync.Mutex
|
||||
)
|
||||
|
||||
func initCache() {
|
||||
func initCache(initDB bool) {
|
||||
var err error
|
||||
|
||||
log.Println("Caching obj_type ..")
|
||||
@ -66,6 +66,29 @@ func initCache() {
|
||||
err = loadObjJob()
|
||||
logOnError(err, "initCache : caching jobs")
|
||||
|
||||
if initDB {
|
||||
_, _ = addObjCastle(`🦌`, `Deerhorn`)
|
||||
_, _ = addObjCastle(`🐉`, `Dragonscale`)
|
||||
_, _ = addObjCastle(`🦅`, `Highnest`)
|
||||
_, _ = addObjCastle(`🌑`, `Moonlight`)
|
||||
_, _ = addObjCastle(`🥔`, `Potato`)
|
||||
_, _ = addObjCastle(`🦈`, `Sharkteeth`)
|
||||
_, _ = addObjCastle(`🐺`, `Wolfpack`)
|
||||
_, _ = addObjCastle(`⛔`, `Unknown`)
|
||||
_, _ = addObjGuild(``, `No Guild`)
|
||||
}
|
||||
|
||||
log.Println("Caching castles ..")
|
||||
err = loadObjCastle()
|
||||
logOnError(err, "initCache : caching castles")
|
||||
|
||||
log.Println("Caching clients ..")
|
||||
err = loadClients()
|
||||
|
||||
if initDB {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func loadObjType() error {
|
||||
|
Loading…
Reference in New Issue
Block a user