ncr / background-fu Goto Github PK
View Code? Open in Web Editor NEWRunning Long Background Tasks In Ruby On Rails Made Dead Simple
Running Long Background Tasks In Ruby On Rails Made Dead Simple
When I try to add a job, it goes crazy on me -
Job.enqueue!(ExampleWorker, :add, 1, 2).id
RuntimeError: repository delegated to @cache_config.repository, but @cache_config is nil: Job(id: integer, worker_class: string, worker_method: string, args: text, result: text, priority: integer, progress: integer, state: string, lock_version: integer, start_at: datetime, started_at: datetime, created_at: datetime, updated_at: datetime)
Any ideas?
As you might know, the plugin doesn't work in Rails 3. It would be nice to get this working as this plugin appears to be very good. Thanks in advance.
Do the Jobs views & controllers, other scaffolding provided with b-fu really need to be generated? I don't see anything in them where templates are needed. We could just add a UI path and add it to the necessary load paths. Developers have to add to their routes.rb anyway. See http://github.com/jrwest/rcumber for an example.
In rails/init.rb requiering the job files didn't work. The fix solve this issue:
diff --git a/rails/init.rb b/rails/init.rb index 94ed1be..215a29a 100644 --- a/rails/init.rb +++ b/rails/init.rb @@ -1,12 +1,12 @@ require 'background_fu' require 'background_fu/worker_monitoring' -require 'job' -require 'job/bonus_features' +require 'background_fu/job' +require 'background_fu/job/bonus_features' ActiveSupport::Dependencies.load_paths << "#{RAILS_ROOT}/lib/workers" # comment out these lines if to disable callbacks -require 'job/callbacks' +require 'background_fu/job/callbacks' Job.send(:include, Job::Callbacks) #ref http://guides.rubyonrails.org/2_2_release_notes.html says 2.2 onwards allow_concurrency deprecated
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.