Better visual sync
This commit is contained in:
parent
40a68d6ad0
commit
d9c82868ab
6 changed files with 130 additions and 106 deletions
6
main.go
6
main.go
|
|
@ -25,7 +25,7 @@ import (
|
|||
|
||||
const VERSION = "v1"
|
||||
const CONTEXT_USER = 1
|
||||
const SYNC_PAGINATION = 100
|
||||
const SYNC_PAGINATION = 500
|
||||
|
||||
var (
|
||||
FlagGenerate bool
|
||||
|
|
@ -269,9 +269,11 @@ func actionSyncFromServer(w http.ResponseWriter, r *http.Request) { // {{{
|
|||
return
|
||||
}
|
||||
|
||||
/*
|
||||
Log.Debug("/sync/from_server", "num_nodes", len(nodes), "maxSeq", maxSeq)
|
||||
foo, _ := json.Marshal(nodes)
|
||||
os.WriteFile(fmt.Sprintf("/tmp/nodes-%d.json", offset), foo, 0644)
|
||||
*/
|
||||
|
||||
j, _ := json.Marshal(struct {
|
||||
OK bool
|
||||
|
|
@ -288,7 +290,6 @@ func actionSyncFromServerCount(w http.ResponseWriter, r *http.Request) { // {{{
|
|||
user := getUser(r)
|
||||
changedFrom, _ := strconv.Atoi(r.PathValue("sequence"))
|
||||
|
||||
Log.Debug("FOO", "UUID", user.ClientUUID, "changedFrom", changedFrom)
|
||||
count, err := NodesCount(user.UserID, uint64(changedFrom), user.ClientUUID)
|
||||
if err != nil {
|
||||
Log.Error("/sync/from_server/count", "error", err)
|
||||
|
|
@ -341,7 +342,6 @@ func actionSyncToServer(w http.ResponseWriter, r *http.Request) { // {{{
|
|||
return
|
||||
}
|
||||
|
||||
|
||||
responseData(w, map[string]any{
|
||||
"OK": true,
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue