I have been trying to setup bj with rails 2.1.0 and am having some
problems, was wondering if anyone could help. Here is what I’ve done
so far.
-
Basic rails install
$ rails tester -
Install bj
$ cd tester
$ ./script/plugin install
http://codeforpeople.rubyforge.org/svn/rails/plugins/bj -
Setup bj
$ ./script/bj setup -
Submit a job to the queue
$ ./script/console
$ Bj.submit ‘ls’
At that point, it puts the job in the database
Bj.table.job.all
=> [#<Bj::Table::Job bj_job_id: 1, command: “ls”, state: “pending”,
priority: 0, tag: “”, is_restartable: 1, submitter: “dustymini.local”,
runner: nil, pid: nil, submitted_at: “2008-07-22 01:15:46”,
started_at: nil, finished_at: nil, env: nil, stdin: nil, stdout: nil,
stderr: nil, exit_status: nil>]
The config setting shows this:
Bj.table.config.all
=> [#<Bj::Table::Config bj_config_id: 1, hostname: “dustymini.local”,
key: “development.23928.pid”, value: “23934”, cast: “to_i”>]
And, it seems to fire off the bj process to run that job
$ ps axwww | grep -i bj
23934 s000 R+ 0:01.99 /opt/local/bin/ruby /Users/dusty/tester/
script/bj run --forever --redirect=/Users/dusty/tester/log/
bj.dustymini.local.development.log --ppid=23928 –
rails_env=development --rails_root=/Users/dusty/tester
But, the job is never run, and I don’t have any errors. Here is some
snippets from my logs
$ cat log/bj.dustymini.local.development.log
I, [2008-07-21T21:15:48.828069 #23934] INFO – : STARTED
$ cat log/development.log
Bj::Table::Job Create (0.000862) INSERT INTO
“bj_job” (“is_restartable”, “pid”, “stdout”, “stdin”, “command”,
“submitter”, “finished_at”, “env”, “stderr”, “submitted_at”,
“priority”, “tag”, “runner”, “started_at”, “exit_status”, “state”)
VALUES(1, NULL, NULL, NULL, ‘ls’, ‘dustymini.local’, NULL, NULL, NULL,
‘2008-07-22 01:22:37’, 0, ‘’, NULL, NULL, NULL, ‘pending’)
Bj::Table::Config Load (0.000479) SELECT * FROM “bj_config” WHERE
(“bj_config”.“key” = ‘development.no_tickle’ AND
“bj_config”.“hostname” = ‘dustymini.local’) LIMIT 1
Bj::Table::Config Load (0.000446) SELECT * FROM “bj_config” WHERE
(“bj_config”.“key” = ‘development.no_tickle’ AND
“bj_config”.“hostname” = ‘') LIMIT 1
Bj::Table::Config Load (0.001018) SELECT * FROM “bj_config” WHERE
(“bj_config”.“key” = ‘development.23928.pid’ AND
“bj_config”.“hostname” = ‘dustymini.local’) LIMIT 1
Bj::Table::Config Load (0.001485) SELECT * FROM “bj_config” WHERE
(“bj_config”.“key” = ‘23934.uri’ AND “bj_config”.“hostname” =
‘dustymini.local’) LIMIT 1
Bj::Table::Config Load (0.000288) SELECT * FROM “bj_config” WHERE
(“bj_config”.“key” = ‘23934.uri’ AND “bj_config”.“hostname” = '’)
LIMIT 1
Any ideas on how I can get this to run my job queue?
Thanks