pampa_workers 1.1.38 → 1.1.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/mylocalprocess.rb +4 -3
- data/lib/myprocess.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cd2d24e0e83c7a7d51a982cfa16026e1ae34a518
|
|
4
|
+
data.tar.gz: f6c5ee2488fe67be969f879405dad5f7da78b552
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 936f46faed7a154b3fbb9477038cd6cacf9f68018ed1d7d893d48717f7cec9429be045379f609800facf3f791b30294b9b188a80fefa3ba165cd8e88e329fff3
|
|
7
|
+
data.tar.gz: 25b698f4b79efcb17ab6307c1cac97b1fd336f5ffb8898fd017025722de137a772063c8eb7c80479a8b8d595ca8cb94a8b876a91884b057e86dee343ecc1cc1b
|
data/lib/mylocalprocess.rb
CHANGED
|
@@ -27,7 +27,7 @@ module BlackStack
|
|
|
27
27
|
return BlackStack::Division.where(:central=>true).first
|
|
28
28
|
end
|
|
29
29
|
end
|
|
30
|
-
|
|
30
|
+
|
|
31
31
|
def worker()
|
|
32
32
|
BlackStack::Worker.where(:name=>self.fullWorkerName).first
|
|
33
33
|
end
|
|
@@ -95,7 +95,7 @@ module BlackStack
|
|
|
95
95
|
while (self.canRun?)
|
|
96
96
|
# reseteo en contador nested del logger
|
|
97
97
|
self.logger.reset()
|
|
98
|
-
|
|
98
|
+
|
|
99
99
|
# announcing my in the log
|
|
100
100
|
logger.log "Going to Run Local"
|
|
101
101
|
logger.log "Process: #{self.assigned_process.to_s}."
|
|
@@ -110,7 +110,7 @@ module BlackStack
|
|
|
110
110
|
GC.start
|
|
111
111
|
DB.disconnect
|
|
112
112
|
logger.done
|
|
113
|
-
|
|
113
|
+
|
|
114
114
|
# cargo el objeto worker
|
|
115
115
|
logger.logs "Load the worker... "
|
|
116
116
|
the_worker = self.worker
|
|
@@ -132,6 +132,7 @@ module BlackStack
|
|
|
132
132
|
|
|
133
133
|
rescue => e
|
|
134
134
|
puts ""
|
|
135
|
+
self.notifyError(nil, "Local Process Error: #{e.to_s}\n#{e.backtrace.join("\n")}")
|
|
135
136
|
logger.log "Local Process Error: " + e.to_s + "\r\n" + e.backtrace.join("\r\n").to_s
|
|
136
137
|
end
|
|
137
138
|
|
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, assigned_process=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,7 +42,6 @@ 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,
|