Don't return INVALID on seed-related function error

pull/11/head
maru 8 months ago
parent eea2266920
commit b5e8094039
No known key found for this signature in database
GPG Key ID: 37689350E9CD0F0D

@ -72,12 +72,12 @@ func Init() error {
time.Sleep(time.Second)
seed, err = recordNewDaily()
log.Printf("Daily Run Seed: %s", seed)
if err != nil {
log.Printf("error while recording new daily: %s", err)
} else {
log.Printf("Daily Run Seed: %s", seed)
}
})
if err != nil {
return err
}

@ -27,7 +27,7 @@ func TryAddDailyRun(seed string) (string, error) {
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)
if err != nil {
return "INVALID", err
return "", err
}
return actualSeed, nil
@ -37,7 +37,7 @@ func GetDailyRunSeed() (string, error) {
var seed string
err := handle.QueryRow("SELECT seed FROM dailyRuns WHERE date = UTC_DATE()").Scan(&seed)
if err != nil {
return "INVALID", err
return "", err
}
return seed, nil

Loading…
Cancel
Save