Permalink
Browse files

some tunings and fixings

  • Loading branch information...
1 parent 242d98c commit 6e12d36b5ddb095e26901032ed1bccf18ce298a8 @AlexKVal committed Jan 7, 2012
Showing with 25 additions and 4 deletions.
  1. +1 −0 .gitignore
  2. +3 −3 client_run_me.rb
  3. +1 −0 config.rb
  4. +19 −0 config.rb.example
  5. +1 −1 lib/client/client.rb
View
1 .gitignore
@@ -1,3 +1,4 @@
+config.rb
.rvmrc
*.sqlite3
sqlite3.dll
View
6 client_run_me.rb
@@ -11,14 +11,14 @@ module Filial
while true
LOG.debug "==> Main Loop <=="
- if client.get_trackings!
- client.get_trackings!
+ res = client.get_trackings!
+ #if res
LOG.info "==> got trackings"
client.prepare_tracked_data
client.send_tracked_data
- end
+ #end
LOG.debug "sleep for #{MAIN_LOOP_PAUSE}"
sleep MAIN_LOOP_PAUSE
View
1 config.rb
@@ -1,6 +1,7 @@
# Filial-side
FILIAL_ID = 'Chab' # used for distinguish connections on server-side
SERVER_URI = 'druby://10.0.26.110:8083'
+CALLBACK_URI = 'druby://10.0.35.230:20083'
SECONDS_WAIT_SERVER = 10
FILIAL_ALIAS = "D2Exp.NET"
MAIN_LOOP_PAUSE = 5
View
19 config.rb.example
@@ -0,0 +1,19 @@
+# Filial-side
+FILIAL_ID = 'Name' # used for distinguish connections on server-side
+SERVER_URI = 'druby://server_ip:8083'
+CALLBACK_URI = 'druby://client_ip:20083'
+SECONDS_WAIT_SERVER = 10
+FILIAL_ALIAS = "DBalias.NET"
+MAIN_LOOP_PAUSE = 5
+
+# Central-side
+#CENTRAL_ALIAS = "CentrName.NET" # alias for filial db on central server
+#CENTRAL_PREFIX = 'name' # prefix for tables
+#LISTEN_URI = 'druby://:8083'
+
+# DRb
+$SAFE = 1 # disable eval() and friends
+
+# Common
+LOG_FILENAME = nil #'log.txt' # if nil then log to stdout
+LOG_VERBOSE = true
View
2 lib/client/client.rb
@@ -71,7 +71,7 @@ def send_tracked_data
LOG.debug "break"
break
rescue
- LOG.info "Waiting till server is online. Sleep for #{@seconds_wait} seconds"
+ LOG.info "!==> rescue: #{$!}. Sleep #{@seconds_wait}"
sleep @seconds_wait
end while @infinite

0 comments on commit 6e12d36

Please sign in to comment.