require 'logger' require 'multi_json' require 'active_support/all' require_relative 'plugin_worker/version' require_relative 'plugin_worker/utils' require_relative 'plugin_worker/worker' require_relative 'plugin_worker/errors' require_relative 'plugin_worker/runner' require_relative 'plugin_worker/runner_local' if ENV['RACK_ENV'] == 'development' ######################################################################################################################## # The following is run if file is required from within Iron Worker if ENV['PWD'] == '/mnt/task' require 'iron_worker' require 'fanforce/plugin_factory/load_from_worker' Fanforce::Plugin.load(nil) Plugin = Fanforce::Plugin PluginWorker = Fanforce::PluginWorker PluginWorker.is_iron_worker(true) # When running in Docker, IronWorker no longer provides the params method def worker_data; IronWorker.payload end puts 'FINISHED LOADING PLUGIN' else puts "UNKNOWN CALLER: #{caller[0].split(':')[0]}" end