Commit daeb3b6a authored by Markus Seidl's avatar Markus Seidl

Use int64 for timestamp comparison

parent db257735
......@@ -4,7 +4,6 @@ import (
"fmt"
"io"
"io/ioutil"
"log"
"math/rand"
"os"
"path/filepath"
......@@ -99,22 +98,18 @@ func (d *Database) Next(baseFile string) string {
}
_, baseName := filepath.Split(baseFile)
baseInt, _ := strconv.Atoi(baseName)
baseInt, _ := strconv.ParseInt(baseName, 10, 64)
// flaky, this might not find the real next every time
log.Println(">>>>>")
for _, e := range files {
_, filename := filepath.Split(e)
unixtime, _ := strconv.Atoi(filename)
log.Println(filename, unixtime)
unixtime, _ := strconv.ParseInt(filename, 10, 64)
if unixtime > baseInt {
return e
}
}
log.Println("<<<<<<")
if len(files) > 0 {
return files[0]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment