tiny_work_service 3.0.0 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tiny_work_service.rb +5 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3b785423b4fed5c70b3d1a0edeec40270ecf8ec3e9c2c5959bc147cadd152fe8
|
4
|
+
data.tar.gz: 8b94f8906d00b5d1eda6989bdb20215be2db7b2122f1b2fee184cad89d506cbe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1003c35da546314d8ca952cc96dfe3dff7b6cd63f3c5fbcde8be9eb828685024d41f946f50df1482fe54bf04f1dc0d088c0e165940f660e024b0916b3e0e6896
|
7
|
+
data.tar.gz: 95cb6711d1ebe2914cd638024c7566e6dfd578e7b8e4916d2b320f616ec7de39eb048a79ade2b3b1b12361ac231b986d9f0e7872b5fe4ae687ba4e51bb6c453f
|
data/lib/tiny_work_service.rb
CHANGED
@@ -24,6 +24,7 @@ class TinyWorkService
|
|
24
24
|
|
25
25
|
@jobs_per_minute = 0
|
26
26
|
@jobs_per_hour = 0
|
27
|
+
@errors_total = 0
|
27
28
|
|
28
29
|
# status printing thread
|
29
30
|
Thread.new do
|
@@ -41,7 +42,8 @@ class TinyWorkService
|
|
41
42
|
puts "workers : #{@service.num_clients.to_s.rjust(28)}\e[K"
|
42
43
|
puts "queue : #{@jobs.length.to_s.rjust(28)}\e[K"
|
43
44
|
puts "jobs/m : #{@jobs_per_minute.to_s.rjust(28)}\e[K"
|
44
|
-
|
45
|
+
puts "jobs/h : #{@jobs_per_hour.to_s.rjust(28)}\e[K"
|
46
|
+
print "errors : #{@errors_total.to_s.rjust(28)}\e[K"
|
45
47
|
sleep refresh_interval_in_seconds
|
46
48
|
end
|
47
49
|
print "\e[?25h" # show cursor
|
@@ -90,6 +92,8 @@ class TinyWorkService
|
|
90
92
|
'ok' # ok, job received
|
91
93
|
when m[0] == '-' # take a job from the queue
|
92
94
|
shift || ''
|
95
|
+
when m[0] == '!' # register an error
|
96
|
+
@errors_total += 1
|
93
97
|
else
|
94
98
|
raise TinyTCPService::BadClient.new("Client sent invalid message: `#{m[..50]}'")
|
95
99
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tiny_work_service
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeff Lunt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-01-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tiny_tcp_service
|