zold 0.14.51 → 0.14.52

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 53fed8a92732a47d8473dd93dcfccf0cc5aac6cd2dad450068779d3faabc8849
4
- data.tar.gz: 6eb21513a8b304eb81ad3ef3d46f8c8d802aa0be3b409e06bdadaf5c6021ee88
3
+ metadata.gz: 3f2a2f29076ab430c597f9d07c7a72b7f10a378e3c69b9ff755b04f644accdb9
4
+ data.tar.gz: 5bab77f75e6b20cf1e80cb1f8bea44353ec0060e523c0c2c08614334d728c22b
5
5
  SHA512:
6
- metadata.gz: 86cee566355856078b67b2f90f150458158f24a3e5d1681c580c86227dbdffac875c01377e3b69987dca088ed026351a623d02a1f51e653fbfb1ee1b8bd7372f
7
- data.tar.gz: 55d61bc63a682151a23a35098449c5798f4ba783101ec8d609a0511cb0462c4f1344e9c191e4b53ae2093c1c576463438c247afea8ef84c72afd6785556f263d
6
+ metadata.gz: 7aec846b0b6443e195e989a414254fe80bca5e810b19000e60e574ba4721b64cb3ac820f85811c96b2a23db45c1c64291d0ae63e1eb619a30d5f27406354a432
7
+ data.tar.gz: 41d673a22f703fc01bdc857f61a7c82d3fa34059e1a05c2cd759532d65606df723e2810bff55ab44d6f2ef9f2c0914ec9c713ea557924b1244b1f6575c17ad3f
@@ -39,6 +39,9 @@ module Zold
39
39
  opts = Slop.parse(args, help: true, suppress_errors: true) do |o|
40
40
  o.banner = "Usage: zold next [options] score
41
41
  Available options:"
42
+ o.bool '--low-priority',
43
+ 'Set the lowest priority to this process',
44
+ default: false
42
45
  o.bool '--help', 'Print instructions'
43
46
  end
44
47
  if opts.help?
@@ -51,6 +54,7 @@ Available options:"
51
54
  private
52
55
 
53
56
  def calculate(opts)
57
+ Process.setpriority(Process::PRIO_PROCESS, 0, 20) if opts['low-priority']
54
58
  @log.info(Score.parse(opts.arguments.drop_while { |a| a.start_with?('--') }[1]).next.to_s)
55
59
  end
56
60
  end
@@ -176,7 +176,7 @@ module Zold
176
176
  return unless s.strength >= strength
177
177
  Thread.current.name = s.to_mnemo
178
178
  bin = File.expand_path(File.join(File.dirname(__FILE__), '../../../bin/zold'))
179
- Open3.popen2e("ruby #{bin} --skip-upgrades next \"#{s}\"") do |stdin, stdout, thr|
179
+ Open3.popen2e("ruby #{bin} --skip-upgrades --low-priority next \"#{s}\"") do |stdin, stdout, thr|
180
180
  @log.debug("Score counting started in process ##{thr.pid}")
181
181
  begin
182
182
  stdin.close
data/lib/zold/version.rb CHANGED
@@ -25,6 +25,6 @@
25
25
  # Copyright:: Copyright (c) 2018 Yegor Bugayenko
26
26
  # License:: MIT
27
27
  module Zold
28
- VERSION = '0.14.51'
28
+ VERSION = '0.14.52'
29
29
  PROTOCOL = 2
30
30
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zold
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.51
4
+ version: 0.14.52
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko