pampa_workers 1.1.37 → 1.1.40

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: acfb10a1b7c85ff28da7bd78336fb50bd1bab2fd
4
- data.tar.gz: 88b45ef4d3e3766cc6e6fb5cab4de98aed251196
3
+ metadata.gz: b76ec0b8c9345d4b2f8fcd41e69f77bac24a8358
4
+ data.tar.gz: 7ab23816c131a8ddc9ed61c3c481bb744468de06
5
5
  SHA512:
6
- metadata.gz: 12257f58a67f506832dcd5907b7eccf3b710b03d729955f05774ca9c0c4d1160c0d87487514691e2618b9cda2de735bc9aba18e6bf59764b3dacd049ab52ca3c
7
- data.tar.gz: 3ddb29b711b144b64d0fa0801c059940976a7925bb6b28015c6bdd1bf26d3897df08be076cb12fcd9b9171d9a0521349410e6a7392d6486f681dd21dee5f4062
6
+ metadata.gz: 9276baefe7c485cf999f663debfd3085ba1565e81160b19104be1fc78238aee8d08b0ee0571899704a42538f593569e53264d23afad81f8edd90fc4a5650dc40
7
+ data.tar.gz: 2255c7d576291513336d4b6e36e8642b9a23b4c0170cef1a63a08c9bbb5542715447ef0ec38ffef48d81634d844b5cfc43124801d03287065e7745ac6d5d57bb
@@ -27,7 +27,12 @@ module BlackStack
27
27
  return BlackStack::Division.where(:central=>true).first
28
28
  end
29
29
  end
30
-
30
+
31
+ def notifyError(uid, description, oid=nil, screenshot_file=nil, url=nil, assigned_process=nil)
32
+ url = "#{CS_HOME_PAGE_PROTOCOL}://#{self.division.home.app_url}:#{self.division.home.app_port}/api1.3/bots/boterror.json" if url.nil?
33
+ super(uid, description, oid, screenshot_file, url, assigned_process)
34
+ end
35
+
31
36
  def worker()
32
37
  BlackStack::Worker.where(:name=>self.fullWorkerName).first
33
38
  end
@@ -95,7 +100,7 @@ module BlackStack
95
100
  while (self.canRun?)
96
101
  # reseteo en contador nested del logger
97
102
  self.logger.reset()
98
-
103
+
99
104
  # announcing my in the log
100
105
  logger.log "Going to Run Local"
101
106
  logger.log "Process: #{self.assigned_process.to_s}."
@@ -110,7 +115,7 @@ module BlackStack
110
115
  GC.start
111
116
  DB.disconnect
112
117
  logger.done
113
-
118
+ raise 'lalala'
114
119
  # cargo el objeto worker
115
120
  logger.logs "Load the worker... "
116
121
  the_worker = self.worker
@@ -132,6 +137,7 @@ module BlackStack
132
137
 
133
138
  rescue => e
134
139
  puts ""
140
+ self.notifyError(nil, "Local Process Error: #{e.to_s}\n#{e.backtrace.join("\n")}")
135
141
  logger.log "Local Process Error: " + e.to_s + "\r\n" + e.backtrace.join("\r\n").to_s
136
142
  end
137
143
 
data/lib/myprocess.rb CHANGED
@@ -32,7 +32,8 @@ module BlackStack
32
32
  # uid: id de un registro en la tabla lnuser.
33
33
  # description: backtrace de la excepcion.
34
34
  #
35
- def notifyError(uid, description, oid=nil, screenshot_file=nil)
35
+ def notifyError(uid, description, oid=nil, screenshot_file=nil, url=nil, assigned_process=nil)
36
+ url = !url.nil? ? url : "#{BlackStack::Pampa::api_protocol}://#{self.ws_url}:#{self.ws_port}/api1.3/bots/boterror.json"
36
37
  # subo el error
37
38
  nTries = 0
38
39
  bSuccess = false
@@ -41,13 +42,12 @@ module BlackStack
41
42
  while (nTries < 5 && bSuccess == false)
42
43
  begin
43
44
  nTries = nTries + 1
44
- url = "#{BlackStack::Pampa::api_protocol}://#{self.ws_url}:#{self.ws_port}/api1.3/bots/boterror.json"
45
45
  res = BlackStack::Netting::call_post(url, # TODO: migrar a RestClient para poder hacer file upload
46
46
  'api_key' => BlackStack::Pampa::api_key,
47
47
  'id_lnuser' => uid,
48
48
  'id_object' => oid,
49
49
  'worker_name' => PROCESS.fullWorkerName,
50
- 'process' => PROCESS.worker.assigned_process,
50
+ 'process' => !assigned_process.nil? ? assigned_process : PROCESS.worker.assigned_process,
51
51
  'description' => description,
52
52
  'screenshot' => screenshot_file,
53
53
  )
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pampa_workers
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.37
4
+ version: 1.1.40
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leandro Daniel Sardi