Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoMethodError - undefined method `cleanup' for #<CloudCrowd::AssetStore:0x...> #18

Closed
hchoroomi opened this issue Jun 22, 2010 · 3 comments

Comments

@hchoroomi
Copy link

Calling Job#destroy throws undefined method `cleanup' error. Seems autoload doesn't work for some reason.

@jashkenas
Copy link
Member

crowd -c config/cloud_crowd/production -e production console
irb(main):001:0> Job.first.destroy
New RightAws::S3Interface using shared connections mode
Opening new HTTP connection to s3.amazonaws.com:80
=> #<CloudCrowd::Job id: 4254, status: 2, inputs: "[true]", action: "backup_database", 
options: "{}", outputs: "[true]", time: 54.545893, callback_url: nil, email: nil, created_at: 
"2010-06-03 05:00:03", updated_at: "2010-06-03 05:00:57">

Works fine for me. Can you provide a little more context to make it reproducible?

@hchoroomi
Copy link
Author

It works in crowd console. But when you try to access it externally it cannot load asset stores which of course is because it's not initialized correctly.

irb(main):002:0> require 'cloud-crowd'
irb(main):003:0> ActiveRecord::Base.establish_connection(...)
irb(main):004:0> CloudCrowd::Job.first
=> #<CloudCrowd::Job id: 1...
irb(main):005:0> CloudCrowd::Job.first.destroy
=> NoMethodError: undefined method...

Is there a way to configure CloudCrowd to work in this way? Setting asset store directly?

@jashkenas
Copy link
Member

I'm sure you can always go and load the piece you need manually ... but there's probably a simpler way we can accomplish your goal.

If you're trying to clean up old jobs automatically, you can use a "201 Created" response code from your callback_url to signal that the job has been completed successfully, and may be removed.

If your jobs are more fire-and-forget, then you can use crowd cleanup, in conjunction with Cron, if you like.

Both are documented at the bottom of this page:

http://wiki.github.com/documentcloud/cloud-crowd/the-job-api

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants