Don't return INVALID on seed-related function error
parent
eea2266920
commit
b5e8094039
|
@ -72,12 +72,12 @@ func Init() error {
|
||||||
time.Sleep(time.Second)
|
time.Sleep(time.Second)
|
||||||
|
|
||||||
seed, err = recordNewDaily()
|
seed, err = recordNewDaily()
|
||||||
log.Printf("Daily Run Seed: %s", seed)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("error while recording new daily: %s", err)
|
log.Printf("error while recording new daily: %s", err)
|
||||||
|
} else {
|
||||||
|
log.Printf("Daily Run Seed: %s", seed)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@ func TryAddDailyRun(seed string) (string, error) {
|
||||||
var actualSeed string
|
var actualSeed string
|
||||||
err := handle.QueryRow("INSERT INTO dailyRuns (seed, date) VALUES (?, UTC_DATE()) ON DUPLICATE KEY UPDATE date = date RETURNING seed", seed).Scan(&actualSeed)
|
err := handle.QueryRow("INSERT INTO dailyRuns (seed, date) VALUES (?, UTC_DATE()) ON DUPLICATE KEY UPDATE date = date RETURNING seed", seed).Scan(&actualSeed)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "INVALID", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
return actualSeed, nil
|
return actualSeed, nil
|
||||||
|
@ -37,7 +37,7 @@ func GetDailyRunSeed() (string, error) {
|
||||||
var seed string
|
var seed string
|
||||||
err := handle.QueryRow("SELECT seed FROM dailyRuns WHERE date = UTC_DATE()").Scan(&seed)
|
err := handle.QueryRow("SELECT seed FROM dailyRuns WHERE date = UTC_DATE()").Scan(&seed)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "INVALID", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
return seed, nil
|
return seed, nil
|
||||||
|
|
Loading…
Reference in New Issue