浏览代码

fix datetime fromFlatty

jackyzy823 4 年之前
父节点
当前提交
a25bd0855b
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      src/redis_cache.nim

+ 3 - 1
src/redis_cache.nim

@@ -17,7 +17,9 @@ proc toFlatty*(s: var string, x: DateTime) =
   s.toFlatty(x.toTime().toUnix())
 
 proc fromFlatty*(s: string, i: var int, x: var DateTime) =
-  x = fromUnix(s.fromFlatty(int64)).utc()
+  var unix: int64
+  s.fromFlatty(i, unix)
+  x = fromUnix(unix).utc()
 
 proc setCacheTimes*(cfg: Config) =
   rssCacheTime = cfg.rssCacheTime * 60