Index: Makefile ================================================================== --- Makefile +++ Makefile @@ -28,11 +28,11 @@ ezsteps.scm lock-queue.scm sdb.scm rmt.scm api.scm \ subrun.scm portlogger.scm archive.scm env.scm \ diff-report.scm cgisetup/models/pgdb.scm # module source files -MSRCFILES = adjutant.scm mutils.scm mttop.scm ulex.scm +MSRCFILES = adjutant.scm mutils.scm mttop.scm ulex.scm dbmod.scm rmtmod.scm commonmod.scm # ftail.scm rmtmod.scm commonmod.scm removed # MSRCFILES = ducttape-lib.scm pkts.scm stml2.scm cookie.scm mutils.scm \ # mtargs.scm commonmod.scm dbmod.scm adjutant.scm ulex.scm \ # rmtmod.scm apimod.scm Index: apimod.scm ================================================================== --- apimod.scm +++ apimod.scm @@ -28,10 +28,9 @@ (import scheme chicken data-structures extras) (import (prefix sqlite3 sqlite3:) posix typed-records srfi-18) (import commonmod) (import (prefix ulex ulex:)) - -(define (api:execute-requests params) +(define (execute-requests params) #f) ) Index: rmt.scm ================================================================== --- rmt.scm +++ rmt.scm @@ -21,17 +21,16 @@ (use format typed-records) ;; RADT => purpose of json format?? (declare (unit rmt)) (declare (uses api)) (declare (uses http-transport)) +(declare (uses rmtmod)) +(import (prefix rmtmod rmtmod:)) + (include "common_records.scm") (include "db_records.scm") -;; (declare (uses rmtmod)) - -;; (import rmtmod) - ;; ;; THESE ARE ALL CALLED ON THE CLIENT SIDE!!! ;; ;; generate entries for ~/.megatestrc with the following @@ -75,17 +74,23 @@ (set! *rmt-query-last-rest-time* now) (set! *rmt-query-last-call-time* now)) (else ;; sufficient rests have occurred, just record the last query time (set! *rmt-query-last-call-time* now))))) +(define (rmt:send-receive cmd rid params #!key (attemptnum 1)(area-dat #f)) + (if (equal? (configf:lookup *configdat* "setup" "newapi") "yes") + (rmtmod:send-receive cmd rid params attemptnum: 1 area-dat: #f) + (rmt:send-receive-orig cmd rid params attemptnum: 1 area-dat: #f))) + ;; RA => e.g. usage (rmt:send-receive 'get-var #f (list varname)) ;; -(define (rmt:send-receive cmd rid params #!key (attemptnum 1)(area-dat #f)) ;; start attemptnum at 1 so the modulo below works as expected +(define (rmt:send-receive-orig cmd rid params #!key (attemptnum 1)(area-dat #f)) ;; start attemptnum at 1 so the modulo below works as expected #;(common:telemetry-log (conc "rmt:"(->string cmd)) payload: `((rid . ,rid) (params . ,params))) + (if (not (equal? (configf:lookup *configdat* "setup" "query-rest") "no")) (rmt:query-rest cmd rid params)) (if (> attemptnum 2) (debug:print 0 *default-log-port* "INFO: attemptnum in rmt:send-receive is " attemptnum)) Index: rmtmod.scm ================================================================== --- rmtmod.scm +++ rmtmod.scm @@ -17,30 +17,30 @@ ;; along with Megatest. If not, see . ;;====================================================================== (declare (unit rmtmod)) -(declare (uses commonmod)) -(declare (uses apimod)) -;; (declare (uses apimod.import)) (declare (uses ulex)) ;; (include "ulex/ulex.scm") (module rmtmod * (import scheme chicken data-structures extras) (import (prefix sqlite3 sqlite3:) posix typed-records srfi-18) -(import (prefix commonmod cmod:)) -(import apimod) + (import (prefix ulex ulex:)) (defstruct alldat (areapath #f) (ulexdat #f) ) + +(define (send-receive cmd rid params #!key (attemptnum 1)(area-dat #f)) + (print "Got here.") + (exit)) ;; return the handle struct for sending queries to a specific database ;; - initializes the connection object if this is the first access ;; - finds the "captain" and asks who to talk to for the given dbfname ;; - establishes the connection to the current dbowner