run_in_background 1.0.1 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -102,11 +102,11 @@ class WrapperDaemon < Daemon
102
102
  end
103
103
  Log.debug1 'Wrapper was stopped'
104
104
  # let log be written
105
- sleep Params['log_param_max_elapsed_time_in_seconds_from_last_flush'] + 0.5
105
+ Log.flush
106
106
  exit!
107
107
  end
108
108
  Log.error 'Failed to stop service'
109
- sleep Params['log_param_max_elapsed_time_in_seconds_from_last_flush'] + 0.5
109
+ Log.flush
110
110
  #exit!
111
111
  raise 'Failed to stop service'
112
112
  end
@@ -146,7 +146,7 @@ module RunInBackground
146
146
  # if got here then something gone wrong and daemon/service wasn't started in timely manner
147
147
  delete name if exists? name
148
148
  Log.error("daemon/service #{name} wasn't started in timely manner")
149
- sleep(Params['log_param_max_elapsed_time_in_seconds_from_last_flush'] + 0.5)
149
+ Log.flush
150
150
  raise "daemon/service #{name} wasn't started in timely manner"
151
151
  end
152
152
 
@@ -218,7 +218,7 @@ module RunInBackground
218
218
  def RunInBackground.start! name, opts = {}
219
219
  # $0 is the executable name.
220
220
  start(File.expand_path($0), ARGV, name, opts)
221
- sleep Params['log_param_max_elapsed_time_in_seconds_from_last_flush'] + 0.5
221
+ Log.flush
222
222
  exit!
223
223
  end
224
224
 
@@ -248,7 +248,7 @@ module RunInBackground
248
248
  # if got here then something gone wrong and daemon/service wasn't started in timely manner
249
249
  delete name if exists? name
250
250
  Log.error("daemon/service #{name} wasn't started in timely manner")
251
- sleep(Params['log_param_max_elapsed_time_in_seconds_from_last_flush'] + 0.5)
251
+ Log.flush
252
252
  raise "daemon/service #{name} wasn't started in timely manner"
253
253
  end
254
254
 
@@ -325,7 +325,7 @@ module RunInBackground
325
325
  end
326
326
  # if got here then something gone wrong and daemon/service wasn't deleted in timely manner
327
327
  Log.error("daemon/service #{name} wasn't deleted in timely manner")
328
- sleep(Params['log_param_max_elapsed_time_in_seconds_from_last_flush'] + 0.5)
328
+ Log.flush
329
329
  raise "daemon/service #{name} wasn't deleted in timely manner"
330
330
  end
331
331
 
@@ -420,10 +420,11 @@ module RunInBackground
420
420
  Log.warning(msg)
421
421
  end
422
422
  else
423
- msg = "Unsupported command #{Params['bg_command']}. Supported commands are: start, delete"
423
+ msg = "Unsupported command #{Params['bg_command']}. Supported commands are: start, delete"
424
424
  puts msg
425
425
  Log.error(msg)
426
426
  end
427
+ nil
427
428
  end
428
429
 
429
430
  private_class_method :start_linux, :start_windows, :wrap_windows, :stop, :get_abs_std_path, \
@@ -1,3 +1,3 @@
1
1
  module RunInBackground
2
- VERSION = "1.0.1"
2
+ VERSION = "1.1.0"
3
3
  end
@@ -20,7 +20,6 @@ begin
20
20
  # C:/Documents and Settings/NetworkService/.bbfs/test_app_<pid>.log
21
21
  Params['log_file_name'] = File.join(Dir.home, '.bbfs', "#{File.basename(__FILE__)}_#{Process.pid}.log")
22
22
  Params['log_write_to_console'] = false
23
- Params['log_param_max_elapsed_time_in_seconds_from_last_flush'] = 1
24
23
  if DBG
25
24
  Params['log_debug_level'] = 1
26
25
  Log.init
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: run_in_background
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-25 00:00:00.000000000 Z
12
+ date: 2013-06-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: log