Skip to content

Commit 6a699bb

Browse files
committed
Save timestamp as string for BSON
To resolve errors where BSON doesn't manage to reconstruct the DateTime.
1 parent 4d8de84 commit 6a699bb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/function.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ function cache(@nospecialize(f), path::AbstractString; overwrite = false)
7676
if ext == ".bson"
7777
data = Dict(
7878
:version => version,
79-
:whenrun => whenrun,
79+
:whenrun => string(whenrun),
8080
:runtime => runtime,
8181
:output => output,
8282
)

test/items/function.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
if ext == "bson"
5555
data = BSON.load(path)
5656
version = data[:version]
57-
whenrun = data[:whenrun]
57+
whenrun = DateTime(data[:whenrun])
5858
runtime = data[:runtime]
5959
else
6060
data = JLD2.load(path)

0 commit comments

Comments
 (0)