Megatest

Check-in [8528e93d3c]
Login
Overview
Comment:Added little more feedback for sync. Return numbers as numbers from no-sync metadata
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | v1.64 | v1.6417
Files: files | file ages | folders
SHA1: 8528e93d3ce01d0b8b209c599ab261aa1987a108
User & Date: mrwellan on 2017-06-02 09:54:03
Other Links: branch diff | manifest | tags
Context
2017-06-05
18:01
Added first pass implementation of teamcity inteface wrapper check-in: 0279fc7474 user: mrwellan tags: v1.64
2017-06-03
09:47
Merged latest from v1.64 into v1.65 check-in: 8a26c9c9d7 user: matt tags: v1.65
2017-06-02
09:54
Added little more feedback for sync. Return numbers as numbers from no-sync metadata check-in: 8528e93d3c user: mrwellan tags: v1.64, v1.6417
07:22
Sync should not be called if some other process has called it recently check-in: f0c7e06411 user: matt tags: v1.64
Changes

Modified common.scm from [d262d87a84] to [2320d45f7a].

715
716
717
718
719
720
721

722
723
724
725




726
727
728
729
730
731
732
715
716
717
718
719
720
721
722




723
724
725
726
727
728
729
730
731
732
733







+
-
-
-
-
+
+
+
+







				  (let ((db (cdr *task-db*)))
				    (if (sqlite3:database? db)
					(begin
					  (sqlite3:interrupt! db)
					  (sqlite3:finalize! db #t)
					  ;; (vector-set! *task-db* 0 #f)
					  (set! *task-db* #f)))))
                              (http-client#close-all-connections!)
                              (if (and *runremote*
                                       (remote-conndat *runremote*))
                                  (begin
                                    (http-client#close-all-connections!))) ;; for http-client
                              ;; (if (and *runremote*
                              ;;          (remote-conndat *runremote*))
                              ;;     (begin
                              ;;       (http-client#close-all-connections!))) ;; for http-client
                              (if (not (eq? *default-log-port* (current-error-port)))
                                  (close-output-port *default-log-port*))
			      (set! *default-log-port* (current-error-port))) "Cleanup db exit thread"))
	  (th2 (make-thread (lambda ()
			      (debug:print 4 *default-log-port* "Attempting clean exit. Please be patient and wait a few seconds...")
			      (if no-hurry
                                  (begin

Modified db.scm from [e9a95e918d] to [5231964fde].

1052
1053
1054
1055
1056
1057
1058

1059

1060
1061
1062



1063
1064
1065
1066
1067
1068
1069
1052
1053
1054
1055
1056
1057
1058
1059

1060



1061
1062
1063
1064
1065
1066
1067
1068
1069
1070







+
-
+
-
-
-
+
+
+







				 (begin
				   (if no-sync-db
				       (db:no-sync-set no-sync-db "LAST_UPDATE" start-time))
				   (db:tmp->megatest.db-sync dbstruct last-update))
				 0))
	 (sync-time           (- (current-seconds) start-time)))
      (debug:print-info 3 *default-log-port* "Sync of newdb to olddb completed in " sync-time " seconds pid="(current-process-id))
      (if (common:low-noise-print 30 "sync new to old")
      (if sync-needed
          (if sync-needed
	  ;;     (common:low-noise-print 30 "sync new to old"))
	  (debug:print-info 0 *default-log-port* "Sync of " res " records from newdb to olddb completed in " sync-time " seconds pid="(current-process-id)))
    res))
              (debug:print-info 0 *default-log-port* "Sync of " res " records from newdb to olddb completed in " sync-time " seconds pid="(current-process-id))
              (debug:print-info 0 *default-log-port* "No sync needed, last updated " (- start-time last-update) " seconds ago")))
      res))

;; keeping it around for debugging purposes only
(define (open-run-close-no-exception-handling  proc idb . params)
  (debug:print-info 11 *default-log-port* "open-run-close-no-exception-handling START given a db=" (if idb "yes " "no ") ", params=" params)
  (print "I don't work anymore. open-run-close-no-exception-handling needs fixing or removing...")
  (exit)
  (if (or *db-write-access*
1851
1852
1853
1854
1855
1856
1857




1858


1859
1860
1861
1862
1863
1864
1865
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862

1863
1864
1865
1866
1867
1868
1869
1870
1871







+
+
+
+
-
+
+







  (let ((res default))
    (sqlite3:for-each-row
     (lambda (val)
       (set! res val))
     db
     "SELECT val FROM no_sync_metadat WHERE var=?;"
     var)
    (if res
        (let ((newres (string->number res)))
          (if newres
              newres
    res))
              res))
        res)))

(define (db:no-sync-close-db db)
  (db:safely-close-sqlite3-db db))

;; use a global for some primitive caching, it is just silly to
;; re-read the db over and over again for the keys since they never
;; change