pampa_workers 1.1.28 → 1.1.33
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mylocalprocess.rb +8 -3
- data/lib/myparentprocess.rb +12 -2
- data/lib/myprocess.rb +20 -0
- data/lib/myremoteprocess.rb +14 -8
- data/lib/pampa_workers.rb +0 -10
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c6ec1fcda790dc8a4d05bbc1f591a42cf1519116
|
4
|
+
data.tar.gz: 2946812226ece0641064f5dc282704c6d336e169
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 675e163d62bf0f3e87d6974aaa65777164e7351466d6f943870b99728c4c3d8a42aacdf1f12d2b093ac488c353cc8a7be950b302377647b21b75c5cb24e2e924
|
7
|
+
data.tar.gz: f312b4e504b2ed76ceb7652e20e4508dd007f62f3bcbd01efc0a6fcf139352e52e10328fc43a338ee3f360b27dbdbdc1ba6ff4745ae0a7a38f6a59f4c62af99c
|
data/lib/mylocalprocess.rb
CHANGED
@@ -60,6 +60,7 @@ module BlackStack
|
|
60
60
|
super
|
61
61
|
|
62
62
|
# creo el objeto logger
|
63
|
+
=begin
|
63
64
|
self.logger = RemoteLogger.new(
|
64
65
|
"#{self.fullWorkerName}.log",
|
65
66
|
BlackStack::Pampa::api_protocol,
|
@@ -68,6 +69,10 @@ module BlackStack
|
|
68
69
|
BlackStack::Pampa::api_key,
|
69
70
|
self.id_client # ID of the client that has this thread assigned
|
70
71
|
)
|
72
|
+
=end
|
73
|
+
self.logger = LocalLogger.new(
|
74
|
+
"#{self.fullWorkerName}.log"
|
75
|
+
)
|
71
76
|
|
72
77
|
# announcing my in the log
|
73
78
|
logger.log "Child process is alive!"
|
@@ -83,9 +88,9 @@ module BlackStack
|
|
83
88
|
logger.done
|
84
89
|
|
85
90
|
# actualizo los datos de este worker (parent process)
|
86
|
-
logger.logs "Switch logger id_client (log folder may change)... "
|
87
|
-
self.logger.id_client = self.id_client
|
88
|
-
logger.done
|
91
|
+
# logger.logs "Switch logger id_client (log folder may change)... "
|
92
|
+
# self.logger.id_client = self.id_client
|
93
|
+
# logger.done
|
89
94
|
|
90
95
|
while (self.canRun?)
|
91
96
|
# reseteo en contador nested del logger
|
data/lib/myparentprocess.rb
CHANGED
@@ -7,6 +7,7 @@ module BlackStack
|
|
7
7
|
super
|
8
8
|
|
9
9
|
# creo el objeto logger
|
10
|
+
=begin
|
10
11
|
self.logger = BlackStack::RemoteLogger.new(
|
11
12
|
"#{self.fullWorkerName}.log",
|
12
13
|
BlackStack::Pampa::api_protocol,
|
@@ -15,7 +16,11 @@ module BlackStack
|
|
15
16
|
BlackStack::Pampa::api_key,
|
16
17
|
self.id_client # ID of the client that has this thread assigned
|
17
18
|
)
|
18
|
-
|
19
|
+
=end
|
20
|
+
self.logger = LocalLogger.new(
|
21
|
+
"#{self.fullWorkerName}.log"
|
22
|
+
)
|
23
|
+
|
19
24
|
#
|
20
25
|
pid = nil
|
21
26
|
while (true)
|
@@ -31,6 +36,11 @@ module BlackStack
|
|
31
36
|
|
32
37
|
# consulto a la central por la division asignada
|
33
38
|
url = "#{BlackStack::Pampa::api_url}/api1.3/pampa/hello.json"
|
39
|
+
puts
|
40
|
+
puts
|
41
|
+
puts "url: #{url}"
|
42
|
+
puts
|
43
|
+
puts
|
34
44
|
logger.logs("Hello to the central... ")
|
35
45
|
res = BlackStack::Netting::call_post(url, {
|
36
46
|
'api_key' => BlackStack::Pampa::api_key,
|
@@ -42,8 +52,8 @@ module BlackStack
|
|
42
52
|
else
|
43
53
|
self.logger.done
|
44
54
|
|
45
|
-
logger.logs("Get worker data... ")
|
46
55
|
url = "#{BlackStack::Pampa::api_url}/api1.3/pampa/get.json"
|
56
|
+
logger.logs("Get worker data (#{url})... ")
|
47
57
|
res = BlackStack::Netting::call_post(url, {
|
48
58
|
'api_key' => BlackStack::Pampa::api_key,
|
49
59
|
'name' => self.fullWorkerName }.merge( BlackStack::RemoteHost.new.poll )
|
data/lib/myprocess.rb
CHANGED
@@ -90,6 +90,11 @@ module BlackStack
|
|
90
90
|
def hello()
|
91
91
|
# me notifico a la central. obtengo asignacion si ya la tenia
|
92
92
|
url = "#{BlackStack::Pampa::api_url}/api1.3/pampa/hello.json"
|
93
|
+
puts
|
94
|
+
puts
|
95
|
+
puts "url: #{url}"
|
96
|
+
puts
|
97
|
+
puts
|
93
98
|
res = BlackStack::Netting::call_post(url, {
|
94
99
|
'api_key' => BlackStack::Pampa::api_key,
|
95
100
|
'name' => self.fullWorkerName }.merge( BlackStack::RemoteHost.new.poll )
|
@@ -104,6 +109,11 @@ module BlackStack
|
|
104
109
|
def set(new_assigned_process, new_id_client)
|
105
110
|
if (self.ws_url.to_s.size > 0 && self.ws_port.to_s.size > 0)
|
106
111
|
url = "#{BlackStack::Pampa::api_protocol}://#{self.ws_url.to_s}:#{self.ws_port.to_s}/api1.3/pampa/notify.json"
|
112
|
+
puts
|
113
|
+
puts
|
114
|
+
puts "url: #{url}"
|
115
|
+
puts
|
116
|
+
puts
|
107
117
|
res = BlackStack::Netting::call_post(url, {
|
108
118
|
'api_key' => BlackStack::Pampa::api_key,
|
109
119
|
'name' => self.fullWorkerName,
|
@@ -117,6 +127,11 @@ module BlackStack
|
|
117
127
|
def get()
|
118
128
|
# me notifico a la central. obtengo asignacion que tenga
|
119
129
|
url = "#{BlackStack::Pampa::api_url}/api1.3/pampa/get.json"
|
130
|
+
puts
|
131
|
+
puts
|
132
|
+
puts "url: #{url}"
|
133
|
+
puts
|
134
|
+
puts
|
120
135
|
res = BlackStack::Netting::call_post(url, {
|
121
136
|
'api_key' => BlackStack::Pampa::api_key,
|
122
137
|
'name' => self.fullWorkerName }.merge( BlackStack::RemoteHost.new.poll )
|
@@ -204,6 +219,11 @@ module BlackStack
|
|
204
219
|
|
205
220
|
# me notifico a la division. obtengo trabajo
|
206
221
|
url = "#{BlackStack::Pampa::api_protocol}://#{self.ws_url}:#{self.ws_port}/api1.3/pampa/notify.json"
|
222
|
+
puts
|
223
|
+
puts
|
224
|
+
puts "url: #{url}"
|
225
|
+
puts
|
226
|
+
puts
|
207
227
|
res = BlackStack::Netting::call_post(url,
|
208
228
|
{
|
209
229
|
'api_key' => BlackStack::Pampa::api_key,
|
data/lib/myremoteprocess.rb
CHANGED
@@ -14,6 +14,11 @@ module BlackStack
|
|
14
14
|
# me notifico a la central. obtengo asignacion si ya la tenia
|
15
15
|
# y vuelco la configuracion al remote worker
|
16
16
|
url = "#{BlackStack::Pampa::api_url}/api1.3/pampa/get.json"
|
17
|
+
puts
|
18
|
+
puts
|
19
|
+
puts "url: #{url}"
|
20
|
+
puts
|
21
|
+
puts
|
17
22
|
res = BlackStack::Netting::call_post(url, {
|
18
23
|
'api_key' => BlackStack::Pampa::api_key,
|
19
24
|
'name' => self.fullWorkerName }.merge( BlackStack::RemoteHost.new.poll )
|
@@ -39,8 +44,7 @@ module BlackStack
|
|
39
44
|
|
40
45
|
#
|
41
46
|
def run()
|
42
|
-
|
43
|
-
|
47
|
+
=begin
|
44
48
|
# creo el objeto logger
|
45
49
|
self.logger = RemoteLogger.new(
|
46
50
|
"#{self.fullWorkerName}.log",
|
@@ -50,10 +54,12 @@ module BlackStack
|
|
50
54
|
BlackStack::Pampa::api_key,
|
51
55
|
self.id_client # ID of the client that has this thread assigned
|
52
56
|
)
|
53
|
-
|
57
|
+
=end
|
58
|
+
self.logger = LocalLogger.new(
|
59
|
+
"#{self.fullWorkerName}.log"
|
60
|
+
)
|
61
|
+
|
54
62
|
logger.log "Remote process is alive!"
|
55
|
-
puts
|
56
|
-
puts "api_url:#{BlackStack::Pampa::api_url}"
|
57
63
|
# actualiza parametros de la central
|
58
64
|
logger.logs "Update from central (1-remote)... "
|
59
65
|
self.get
|
@@ -65,9 +71,9 @@ puts "api_url:#{BlackStack::Pampa::api_url}"
|
|
65
71
|
logger.done
|
66
72
|
|
67
73
|
# actualizo los datos de este worker (parent process)
|
68
|
-
logger.logs "Switch logger id_client (log folder may change)... "
|
69
|
-
self.logger.id_client = self.id_client
|
70
|
-
logger.done
|
74
|
+
# logger.logs "Switch logger id_client (log folder may change)... "
|
75
|
+
# self.logger.id_client = self.id_client
|
76
|
+
# logger.done
|
71
77
|
|
72
78
|
while (self.canRun?)
|
73
79
|
|
data/lib/pampa_workers.rb
CHANGED
@@ -154,16 +154,6 @@ module BlackStack
|
|
154
154
|
@@farm_external_ip_addresses = a
|
155
155
|
end
|
156
156
|
|
157
|
-
#
|
158
|
-
def self.get_guid
|
159
|
-
res = BlackStack::Netting::call_post(
|
160
|
-
"#{self.api_url}/api1.4/get_guid.json",
|
161
|
-
{'api_key' => @@api_key}
|
162
|
-
)
|
163
|
-
parsed = JSON.parse(res.body)
|
164
|
-
parsed['value']
|
165
|
-
end
|
166
|
-
|
167
157
|
# Central database connection parameters
|
168
158
|
@@db_url = nil
|
169
159
|
@@db_port = nil
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pampa_workers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.33
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Leandro Daniel Sardi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: websocket
|