lib/ci/queue/redis/base.rb in ci-queue-0.5.2 vs lib/ci/queue/redis/base.rb in ci-queue-0.6.0

- old
+ new

@@ -62,10 +62,16 @@ redis.evalsha(load_script(script), *args) end def load_script(script) @scripts_cache ||= {} - @scripts_cache[script] ||= redis.script(:load, script) + @scripts_cache[script] ||= redis.script(:load, read_script(script)) + end + + def read_script(name) + ::File.read(::File.join(CI::Queue::DEV_SCRIPTS_ROOT, "#{name}.lua")) + rescue SystemCallError + ::File.read(::File.join(CI::Queue::RELEASE_SCRIPTS_ROOT, "#{name}.lua")) end end end end end