add local snapshot to repo; add Dockerfile; update docker-compose.yml;
This commit is contained in:
parent
bc74ef9cbd
commit
d55d7832bc
10 changed files with 2471532 additions and 2 deletions
|
@ -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."})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue