Skip to content

Commit c6f6129

Browse files
committed
fix #344 second task
1 parent 52047d0 commit c6f6129

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Neo4j = "d2adbeaf-5838-5367-8a2f-e46d570981db"
1717
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
1818
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
1919
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
20+
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
2021
Unmarshal = "cbff2730-442d-58d7-89d1-8e530c41eb02"
2122

2223
[compat]

src/DistributedFactorGraphs.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ using Unmarshal
2525
using JSON2 # JSON2 requires all properties to be in correct sequence, can't guarantee that from DB.
2626
using LinearAlgebra
2727
using SparseArrays
28+
using UUIDs
2829

2930

3031
##==============================================================================

src/FileDFG/services/FileDFG.jl

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,14 @@ loadDFG("/tmp/savedgraph.tar.gz", IncrementalInference, dfg)
8686
ls(dfg)
8787
```
8888
"""
89-
function loadDFG(dst::String, iifModule, dfgLoadInto::G; loaddir=joinpath("/","tmp","caesar","random")) where G <: AbstractDFG
89+
function loadDFG(dst::String,
90+
iifModule::Module,
91+
dfgLoadInto::G) where G <: AbstractDFG
92+
93+
94+
#
95+
# loaddir gets deleted so needs to be unique
96+
loaddir=joinpath("/","tmp","caesar","random", string(uuid1()))
9097
# Check if zipped destination (dst) by first doing fuzzy search from user supplied dst
9198
folder = dst # working directory for fileDFG variable and factor operations
9299
dstname = dst # path name could either be legacy FileDFG dir or .tar.gz file of FileDFG files.
@@ -153,9 +160,9 @@ function loadDFG(dst::String, iifModule, dfgLoadInto::G; loaddir=joinpath("/","t
153160

154161
# remove the temporary unzipped file
155162
if unzip
156-
@info "DFG.loadDFG is deleting a temp folder created during unzip, $folder"
163+
@info "DFG.loadDFG is deleting a temp folder created during unzip, $loaddir"
157164
# need this because the number of files created in /tmp/caesar/random is becoming redonkulous.
158-
Base.rm(folder, recursive=true)
165+
Base.rm(loaddir, recursive=true)
159166
end
160167

161168
return dfgLoadInto

0 commit comments

Comments
 (0)