add local snapshot to repo; add Dockerfile; update docker-compose.yml;

This commit is contained in:
davisv7 2025-08-31 15:56:34 -04:00
parent bc74ef9cbd
commit d55d7832bc
10 changed files with 2471532 additions and 2 deletions

View file

@ -56,6 +56,7 @@ func ResetGraphHandler(c *gin.Context) {
memgraph.DropDatabase(Driver)
graph := lnd.PullGraph(LndServices)
lnd.WriteGraphToMemgraph(graph, Driver)
memgraph.SetupAfterImport(Driver)
//IsRoutineRunning = true
StopChannel = make(chan bool)
@ -64,6 +65,22 @@ func ResetGraphHandler(c *gin.Context) {
c.String(http.StatusOK, "Graph update started.")
}
func LoadLocalSnapshot(c *gin.Context) {
fmt.Println("Graph update initiated...")
if IsRoutineRunning {
IsRoutineRunning = false
StopChannel <- true
close(StopChannel)
}
memgraph.DropDatabase(Driver)
lnd.WriteSnapshotToMemgraph("./describegraph.json", Driver)
memgraph.SetupAfterImport(Driver)
c.String(http.StatusOK, "Graph update started.")
}
func GetStatusHandler(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{"isRoutineRunning": IsRoutineRunning,
"message": "Routine stopped."})