Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions core/src/main/scala/flatgraph/Graph.scala
Original file line number Diff line number Diff line change
Expand Up @@ -153,15 +153,16 @@ class Graph(val schema: Schema, val storagePathMaybe: Option[Path] = None) exten
def isClosed: Boolean = closed

override def close(): Unit = {
logger.debug("closing graph")
this.closed = true

for {
storagePath <- storagePathMaybe
if hasChangedSinceOpen
} Serialization.writeGraph(this, storagePath)

logger.info("closed graph")
} {
logger.debug(s"closing graph: start writing changes to $storagePathMaybe")
Serialization.writeGraph(this, storagePath)
logger.info(s"closed graph at $storagePath}")
}
}

override def toString(): String =
Expand Down