coderunner 0.16.9 → 0.16.10
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/VERSION +1 -1
- data/coderunner.gemspec +2 -2
- data/lib/coderunner/class_methods.rb +8 -4
- data/lib/coderunner/system_modules/launcher.rb +4 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 21411f5ad7f57734efea8495ee11742ecf3aa024
|
4
|
+
data.tar.gz: a0ce50ddfeed76e91d1ab19c07af98ec62b5dce4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 36de124b45dfadd6d179fb0dca8b0b3450e5c566da91880b7080908cd2f0aaf8d8783489aeef37cb2a693eb1c97a6ce1184595b4db1cd063f4827f42937cc120
|
7
|
+
data.tar.gz: 16c6d3bc8bc85ba3100adcefad814002d57f5cf44ea1c5fd641ecda2a2194f0555f384bcb2b1d8cb4c9239e37ecb9251b6f57f19808afd38bc2930420439a4a3
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.16.
|
1
|
+
0.16.10
|
data/coderunner.gemspec
CHANGED
@@ -2,12 +2,12 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: coderunner 0.16.
|
5
|
+
# stub: coderunner 0.16.10 ruby lib
|
6
6
|
# stub: ext/extconf.rb
|
7
7
|
|
8
8
|
Gem::Specification.new do |s|
|
9
9
|
s.name = "coderunner"
|
10
|
-
s.version = "0.16.
|
10
|
+
s.version = "0.16.10"
|
11
11
|
|
12
12
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
13
13
|
s.require_paths = ["lib"]
|
@@ -392,16 +392,17 @@ EOF
|
|
392
392
|
unless ENV['CODE_RUNNER_LAUNCHER'] =~ /serial/
|
393
393
|
mutex = Mutex.new
|
394
394
|
processes= []
|
395
|
+
command_list = {}
|
395
396
|
|
396
397
|
Thread.new do
|
397
398
|
loop do
|
398
399
|
`cp #{tl}/queue_status.txt #{tl}/queue_status2.txt`
|
399
|
-
|
400
|
+
#`ps > #{tl}/queue_status.txt`
|
400
401
|
mutex.synchronize do
|
401
402
|
File.open("#{tl}/queue_status.txt", 'a') do |f|
|
402
403
|
# This ensures that the right pids will be listed,
|
403
404
|
# regardless of the way that ps behaves
|
404
|
-
f.puts processes
|
405
|
+
f.puts processes.map{|pid| "#{pid} #{command_list[pid]}"}
|
405
406
|
end
|
406
407
|
end
|
407
408
|
sleep 1
|
@@ -439,12 +440,15 @@ EOF
|
|
439
440
|
exec(command + "\n wait")
|
440
441
|
end
|
441
442
|
`cp #{tl}/queue_status.txt #{tl}/queue_status2.txt; ps > #{tl}/queue_status.txt`
|
442
|
-
mutex.synchronize
|
443
|
+
mutex.synchronize do
|
444
|
+
processes.push pid
|
445
|
+
command_list[pid] = command
|
446
|
+
end
|
443
447
|
|
444
448
|
File.open(tl + '/' + id + '.pid', 'w'){|fle| fle.puts pid}
|
445
449
|
FileUtils.rm(tl + '/' + file)
|
446
450
|
|
447
|
-
Thread.new{Process.wait pid; mutex.synchronize{processes.delete pid}}
|
451
|
+
Thread.new{Process.wait pid; mutex.synchronize{processes.delete pid; command_list.delete(pid)}}
|
448
452
|
end
|
449
453
|
# processes.each{|pid| Process.wait pid}
|
450
454
|
sleep refresh.to_i
|
@@ -11,8 +11,10 @@ class CodeRunner
|
|
11
11
|
launcher_prefix and launcher_prefix.size > 0
|
12
12
|
end
|
13
13
|
def queue_status_launcher
|
14
|
-
|
15
|
-
|
14
|
+
#%x[cat #{CodeRunner.launcher_directory}/queue_status.txt | grep sh] +
|
15
|
+
#%x[cat #{CodeRunner.launcher_directory}/queue_status2.txt | grep sh]
|
16
|
+
%x[cat #{CodeRunner.launcher_directory}/queue_status.txt ] +
|
17
|
+
%x[cat #{CodeRunner.launcher_directory}/queue_status2.txt ]
|
16
18
|
end
|
17
19
|
def execute_launcher
|
18
20
|
launch_id = "#{Time.now.to_i}#{$$}"
|