acpc_table_manager 2.1.2 → 2.1.3
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/acpc_table_manager/maintainer.rb +33 -15
- data/lib/acpc_table_manager/table_queue.rb +1 -1
- data/lib/acpc_table_manager/version.rb +1 -1
- 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: 5fa5f98954ab8a4efc2090a89478d447a2d2a9c0
|
4
|
+
data.tar.gz: 8e2eaa55099066e62d89c583796966ef4432eaa6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ec7782bc01519101d88bebc6b16cdffc2333192f8024b220bdf93c0e9b859f9f4652f2f475d9c386084b024df7399662f2682d23931e69856723ff5b5cd3cad
|
7
|
+
data.tar.gz: b9ab7094f9e74de741009b8c550cd348b6cd679c26c2ba138c223bcbed48a27fb976236b1ddaea9c558bfb5bdfa21b2717db71b6dc4c9386100d87274008f898
|
@@ -24,27 +24,45 @@ module AcpcTableManager
|
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
-
def self.
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
27
|
+
def self.kill_process_if_running(pid)
|
28
|
+
begin
|
29
|
+
AcpcDealer::kill_process pid
|
30
|
+
sleep 1 # Give the process a chance to exit
|
31
|
+
|
32
|
+
if AcpcDealer::process_exists?(pid)
|
33
|
+
AcpcDealer::force_kill_process pid
|
32
34
|
sleep 1 # Give the process a chance to exit
|
33
35
|
|
34
|
-
if AcpcDealer::process_exists?(
|
35
|
-
|
36
|
-
|
36
|
+
if AcpcDealer::process_exists?(pid)
|
37
|
+
yield if block_given?
|
38
|
+
end
|
39
|
+
end
|
40
|
+
rescue Errno::ESRCH
|
41
|
+
end
|
42
|
+
end
|
37
43
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
44
|
+
def self.kill_orphan_proxies(pids, pids_file)
|
45
|
+
new_pids = []
|
46
|
+
pids.each do |pid_pair|
|
47
|
+
proxy_running = AcpcDealer::process_exists?(pid_pair['proxy'])
|
48
|
+
if proxy_running && AcpcDealer::process_exists?(pid_pair['dealer'])
|
49
|
+
new_pids << pid_pair
|
50
|
+
elsif proxy_running
|
51
|
+
kill_process_if_running pid_pair['proxy'] do
|
52
|
+
raise(
|
53
|
+
StandardError.new(
|
54
|
+
"Proxy process #{pid_pair['proxy']} couldn't be killed!"
|
43
55
|
)
|
44
|
-
|
56
|
+
)
|
45
57
|
end
|
46
58
|
else
|
47
|
-
|
59
|
+
kill_process_if_running pid_pair['dealer'] do
|
60
|
+
raise(
|
61
|
+
StandardError.new(
|
62
|
+
"Dealer process #{pid_pair['dealer']} couldn't be killed!"
|
63
|
+
)
|
64
|
+
)
|
65
|
+
end
|
48
66
|
end
|
49
67
|
end
|
50
68
|
new_pids
|
@@ -45,7 +45,7 @@ module AcpcTableManager
|
|
45
45
|
opponents = match.bots(AcpcTableManager.config.dealer_host)
|
46
46
|
|
47
47
|
if opponents.empty?
|
48
|
-
|
48
|
+
force_kill_match! match.id.to_s
|
49
49
|
raise StandardError.new("No opponents found to start for #{match.id.to_s}! Killed match.")
|
50
50
|
end
|
51
51
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acpc_table_manager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dustin Morrill
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pony
|