Skip to content

Commit

Permalink
unthrottled sync a little and fixed newlines in debug
Browse files Browse the repository at this point in the history
  • Loading branch information
nebogeo committed Apr 3, 2018
1 parent fac476a commit 7f32e3b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions android/app/src/main/assets/dbsync.scm
Expand Up @@ -17,6 +17,8 @@

(msg "dbsync.scm")

(define entity-request-limit 20)
(define entity-unlisted-dirtify-limit 20)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; stuff in memory
Expand Down Expand Up @@ -402,8 +404,8 @@

;; if we don't have this entity or the version on the server is newer
(if (and (or (not exists) old)
;; limit this to 5 a time
(< (length r) 5))
;; limit this
(< (length r) entity-request-limit))
(cons (suck-entity-from-server db table unique-id) r)
r)))
'()
Expand All @@ -413,7 +415,7 @@
(msg "mark-unlisted...")
;; load some local entities
;; don't need to do the whole list, as we are iterating here... (and it's slow)
(let ((ids (crop (shuffle (all-unique-ids db table)) 10))
(let ((ids (crop (shuffle (all-unique-ids db table)) entity-unlisted-dirtify-limit))
;; version-data will be 0 instead of '() due to dialogcallback quoting problem
(server-ids (if (and (number? version-data) (eqv? version-data 0))
'() (map car version-data))))
Expand Down
2 changes: 1 addition & 1 deletion android/app/src/main/assets/mongoose.scm
Expand Up @@ -863,7 +863,7 @@
;;

(define (debug! txt)
(set-current! 'debug-text (string-append txt "\n" (get-current 'debug-text ""))))
(set-current! 'debug-text (string-append txt "<br/>" (get-current 'debug-text ""))))

(define (update-debug)
(update-widget 'debug-text-view (get-id "sync-debug") 'text
Expand Down

0 comments on commit 7f32e3b

Please sign in to comment.