Comments (3)
Hmm, that's a tricky one. One option is to just load the Rails environment in script/delayed_job, and then depend on the load path for finding the command. The down side is that this would make the command really slow if you were just doing a --help. Any other ideas?
from delayed_job.
Another issue I just ran into.
When you use gem-plugins (as they are called i believe) - when you convert a plugin to a gem as you have here, and use config.gem to include it in your rails project, the rake tasks do not automatically get included like they do for plugins. You have to explicitly include them.
This being the case I have to create a file under RAILS_ROOT/lib/tasks called delayed_job.rake
the contents of that file are the following:
require File.join(RAILS_ROOT, 'vendor', 'gems', 'collectiveidea-delayed_job-1.8.0', 'tasks', 'tasks')
That basically loads your rake tasks from the gem into the rails rake tasks list so that you can call rake jobs:work or rake jobs:clear
Here is an old lighthouse ticket about this: https://rails.lighthouseapp.com/projects/8994/tickets/59-when-loading-a-plugin-via-rubygems-rake-tasks-aren-t-included-2
I'm not sure if you meant to have your version of delayed_job used in plugin form or gem form, personally I like gems as you can keep track of versioning.
As for the first reported issue,
Is there a way to check the gems included via config.gem? If so I would use that to load the correct path and if it wasn't found I would default to the plugin.
Or if thats not possible looks for a directory in the gems folder matching /delayed_job/ if it is found get the full name of that director and set the require path, otherwise load it from the plugins folder ...
No other good ideas come to mind right now.
~ Tom
from delayed_job.
Rework script/delayed_job so it can be used as a plugin or a gem. Closed by 4d76b8d
from delayed_job.
Related Issues (20)
- Stops performing jobs after few days HOT 1
- Rails 6.1.4.1 - Delayed Job 4.1.9 not processing jobs HOT 1
- Please document a solution to several apps sharing the same legacy database avoiding table name conflict
- Workers crash when Delayed::DeserializationError: ActiveRecord::RecordNotFound is raised HOT 1
- Support `:backend` as a `queue_attribute`
- Is it possible to write delayed_jobs.log to Logs in Openshift pod?
- deleted
- Error since ActiveSupport 7.0.3: `undefined method `silence_warnings' for Delayed::Worker:Class (NoMethodError)` HOT 2
- Upgrading from Rails 5.2.4 to 6.1.6 with Delayed Job - Job's not being picked up HOT 11
- delayed_job script and latest daemons gem HOT 2
- Worker crashes and keeps poison-pill-job in queue
- using DelayedJob results in multiple email Amazon SES HOT 1
- Delayed job failing after successful completion.
- missing __delay__ alias method in performable_mailer.rb for delay method.
- Is there a best practice for a multi-master setup? HOT 1
- DelayedJob kube containers not able to handle SIGQUITs and terminate abruptly
- Race condition but how to debug?
- Timeout doesn't halt job when max_run_time is reached HOT 1
- How does max_attempts interface with ActiveJob retry_on method? HOT 3
- Suggestion: Rake task to lauch multiple monitored workers in a container context
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from delayed_job.