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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/tiny_work_service.rb +5 -1
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6f03cbc2ef873707377dd8d5cc854cedfac5bc284e66a027cdb5fcd99f6c0797
4
- data.tar.gz: 748a6d635f5680107a7b8f9afdcc46ca16db86a3e53db3dd6ce942e4894c9ad1
3
+ metadata.gz: 3b785423b4fed5c70b3d1a0edeec40270ecf8ec3e9c2c5959bc147cadd152fe8
4
+ data.tar.gz: 8b94f8906d00b5d1eda6989bdb20215be2db7b2122f1b2fee184cad89d506cbe
5
5
  SHA512:
6
- metadata.gz: 62dd8cb1257265507eea8d6910d677528ae7e35917342c7733186a497393d8fbdbf7d53d1ee4daba02d6e016c40cff32383c7ae758f685084392ee14e336602d
7
- data.tar.gz: 21e4c97697d3b1c28397ed3012e5f1c26f394771843bd98ff37fd5aa1454fc6a5813f12187376abe5f2b053685a117a6f3b04b7eda5da851c005938cf1f33a17
6
+ metadata.gz: 1003c35da546314d8ca952cc96dfe3dff7b6cd63f3c5fbcde8be9eb828685024d41f946f50df1482fe54bf04f1dc0d088c0e165940f660e024b0916b3e0e6896
7
+ data.tar.gz: 95cb6711d1ebe2914cd638024c7566e6dfd578e7b8e4916d2b320f616ec7de39eb048a79ade2b3b1b12361ac231b986d9f0e7872b5fe4ae687ba4e51bb6c453f
@@ -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
- print "jobs/h : #{@jobs_per_hour.to_s.rjust(28)}\e[K"
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.0.0
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: 2023-11-14 00:00:00.000000000 Z
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