feature/backoffice #6
@@ -41,15 +41,12 @@ func listCartFiles(dir string) ([]CartFileInfo, error) {
|
||||
continue
|
||||
}
|
||||
name := e.Name()
|
||||
var id uint64
|
||||
var id int64
|
||||
var parseErr error
|
||||
parts := strings.Split(name, ".")
|
||||
if len(parts) == 2 && parts[1] == "events.log" {
|
||||
if len(parts) > 1 && parts[1] == "events" {
|
||||
idStr := parts[0]
|
||||
id, parseErr = strconv.ParseUint(idStr, 10, 64)
|
||||
} else if len(parts) == 3 && parts[1] == "events" && parts[2] == "log" {
|
||||
idStr := parts[0]
|
||||
id, parseErr = strconv.ParseUint(idStr, 10, 64)
|
||||
id, parseErr = strconv.ParseInt(idStr, 10, 64)
|
||||
} else {
|
||||
continue
|
||||
}
|
||||
@@ -62,7 +59,7 @@ func listCartFiles(dir string) ([]CartFileInfo, error) {
|
||||
continue
|
||||
}
|
||||
out = append(out, CartFileInfo{
|
||||
ID: id,
|
||||
ID: uint64(id),
|
||||
CartId: cart.CartId(id),
|
||||
Path: p,
|
||||
Size: info.Size(),
|
||||
|
||||
Reference in New Issue
Block a user