--- a/bin/gearman_decode_worker.pl Mon Aug 18 23:01:26 2014 +0200
+++ b/bin/gearman_decode_worker.pl Tue Aug 19 23:51:31 2014 +0200
@@ -13,20 +13,25 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-use Gearman::Worker;
+use Mojo::Base -strict;
+use lib 'lib';
+
use Mojo::JSON;
use Mojo::Util qw(decode slurp);
use Mojo::Loader;
use File::Temp;
-use lib 'lib';
+use Gearman::Worker;
+use Mojolicious;
+use Mojo::Home;
sub load_config {
- my ($file) = @_;
- my $code = decode('UTF-8', slurp $file);
- return eval($code);
+ my $app = Mojolicious->new;
+ $app->home(Mojo::Home->new("$FindBin::Bin/../"));
+ $app->moniker("CrashTest");
+ return $app->plugin('Config');
}
-my $config = load_config($ARGV[0]);
+my $config = load_config();
my $loader = Mojo::Loader->new;
@@ -39,7 +44,6 @@
my $worker = Gearman::Worker->new(job_servers => $config->{DecodeQueue}->{GearmanServers});
-
$worker->register_function("dump_decode", 60, sub {
my $args = $_[0]->arg;