Overview
Comment: | fixes |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | v1.65-dump-for-sync |
Files: | files | file ages | folders |
SHA1: |
bfc2a0c173b70f2221d7e8ca853fb62a |
User & Date: | bjbarcla on 2019-02-08 16:48:37 |
Other Links: | branch diff | manifest | tags |
Context
2019-02-08
| ||
18:49 | really implement the cross-server locking this time check-in: f0c62a0732 user: bjbarcla tags: v1.65-dump-for-sync | |
16:48 | fixes check-in: bfc2a0c173 user: bjbarcla tags: v1.65-dump-for-sync | |
15:09 | added db rotation in .db-snapshot; added some error checking to brute force sync check-in: 78b2c9d57a user: bjbarcla tags: v1.65-dump-for-sync | |
Changes
Modified common.scm from [b1327a8176] to [ddadf02a13].
︙ | ︙ | |||
343 344 345 346 347 348 349 | (if (file-exists? filepath) (let* ((age-sec (lambda (file) (if (file-exists? file) (- (current-seconds) (file-modification-time file)) 1000000000))) ;; return really old value if file doesn't exist. we want to clobber it if old or not exist. (ok-flag #t) (age-mins (lambda (file) (/ (age-sec file) 60))) | | | 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 | (if (file-exists? filepath) (let* ((age-sec (lambda (file) (if (file-exists? file) (- (current-seconds) (file-modification-time file)) 1000000000))) ;; return really old value if file doesn't exist. we want to clobber it if old or not exist. (ok-flag #t) (age-mins (lambda (file) (/ (age-sec file) 60))) (age-hrs (lambda (file) (/ (age-mins file) 60))) (age-days (lambda (file) (/ (age-hrs file) 24))) (age-wks (lambda (file) (/ (age-days file) 7))) (docmd (lambda (cmd) (cond (ok-flag (let ((res (system cmd))) (cond |
︙ | ︙ | |||
395 396 397 398 399 400 401 | (if (not (file-exists? wksfile)) (copy daysfile wksfile)) ;; if age(<file>.mins.gz) >= 1h: ;; copy <file>.mins.gz <file>.hrs.gz ;; copy <prev file> <file>.mins.gz | | | | 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 | (if (not (file-exists? wksfile)) (copy daysfile wksfile)) ;; if age(<file>.mins.gz) >= 1h: ;; copy <file>.mins.gz <file>.hrs.gz ;; copy <prev file> <file>.mins.gz (when (>= (age-mins minsfile) 1) (copy minsfile hrsfile) (copy+zip filepath minsfile)) ;; if age(<file>.hrs.gz) >= 1d: ;; copy <file>.hrs.gz <file>.days.gz ;; copy <file>.mins.gz <file>.hrs.gz (when (>= (age-days hrsfile) 1) (copy hrsfile daysfile) (copy minsfile hrsfile)) ;; if age(<file>.days.gz) >= 1w: ;; copy <file>.days.gz <file>.weeks.gz ;; copy <file>.hrs.gz <file>.days.gz (when (>= (age-wks daysfile) 1) (copy daysfile wksfile) (copy hrsfile daysfile)) #t) #f)) |
︙ | ︙ |
Modified server.scm from [35a6adab78] to [4b55838c84].
︙ | ︙ | |||
501 502 503 504 505 506 507 | ;; (else #f)))) ;; moving this here as it needs access to db and cannot be in common. ;; (define (server:writable-watchdog dbstruct) (thread-sleep! 10) ;; delay for startup (let* ((legacy-sync (common:run-sync?)) | | | 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 | ;; (else #f)))) ;; moving this here as it needs access to db and cannot be in common. ;; (define (server:writable-watchdog dbstruct) (thread-sleep! 10) ;; delay for startup (let* ((legacy-sync (common:run-sync?)) (sqlite-exe (or (get-environment-variable "MT_SQLITE3_EXE"))) ;; defined in cfg.sh (sync-log (or (args:get-arg "-sync-log") (conc *toppath* "/logs/sync-" (current-process-id) "-" (get-host-name) ".log"))) (tmp-area (common:get-db-tmp-area)) (tmp-db (conc tmp-area "/megatest.db")) (staging-file (conc *toppath* "/.megatest.db")) (mtdbfile (conc *toppath* "/megatest.db")) (lockfile (conc tmp-db ".lock")) (sync-cmd (conc sqlite-exe" " tmp-db " .dump | "sqlite-exe" " staging-file "&>"sync-log)) |
︙ | ︙ |