1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00
Commit graph

25 commits

Author SHA1 Message Date
Mike Perham
b427f34331 Only configure reloader/executor in server mode, not necessary in client mode, fixes #3275 2016-12-12 09:39:12 -08:00
Sergey Alexandrovich
5a4e4bb8f4 Monkeypatch Psych to enable Rails autoloading (#3227) 2016-11-22 09:21:16 -08:00
Eugene Kenny
f49b4f11db Use Rails executor if code reloading is disabled (#3221)
We have to release the current thread's Active Record connection after
performing each job, in case another thread is waiting to use it.

On Rails 4 and earlier, this is handled with middleware. On Rails 5 in
development mode, the reloader does it by delegating to the executor.
However on Rails 5 in production mode, we're not adding the middleware
or enabling the reloader, so connections will never be released.

We can call the executor directly to have it release the connection for
us in this case. By calling it inside the middleware stack, the job will
be retried if the executor raises, avoiding the problem with lost jobs
that led to the reloader being disabled in production.
2016-11-12 09:17:36 -05:00
Mike Perham
4b3d5edd18 Don't use the Reloader API at all when caching classes, #3154 2016-10-17 10:54:46 -07:00
Samuel Cochran
659dea9601 Resolve Rails Reloader and ActiveRecord middleware incompatibility (#3166)
* Prevent AR middleware and reloader clash

The ActiveRecord middleware releases any current ActiveRecord
connections before the reloader has a chance to clear their query
caches.

We can just remove this middleware because the reloader takes care of
clearing active connections, too.

* Make sure folks haven't added the middleware manually

* Fix the conditional

* Mention that the reloader also clears connections

* Move it all back into a single method

* Typos

* Pull all rails setup into railtie

* Set the middleware even earlier

Also clarify exactly when these hooks are run.

* Only check ActiveRecord reloader/middleware sanity at boot
2016-09-30 15:27:54 -07:00
Mike Perham
871626c9b3 Refactor Rails 5 integration, per @matthewd 2016-07-01 09:31:08 -07:00
Mike Perham
fbb074fb5f Use cache_classes, rather than environment, to enable reloading 2016-06-15 16:49:40 -07:00
Mike Perham
a67c9b1d90 merge master 2016-06-15 16:48:40 -07:00
Mike Perham
e4d09527c4 polish 2016-04-28 10:38:46 -07:00
Mike Perham
df002c1576 Update reload API for 5.0.beta4 2016-04-28 10:02:03 -07:00
Mike Perham
51347c5d97 Live code reloading, so hot right now! 2016-02-01 15:59:20 -08:00
Mike Perham
2c9f7662fc Freeze all string literals in source, fixes #2741
Tests pass and smoke test works perfectly.
2015-12-31 15:33:35 -08:00
Jason Nochlin
8cf0bf447c Never include modules if .remove_delay was called 2014-06-28 18:20:42 -04:00
Mike Perham
7395f71373 rename method 2014-05-20 20:42:25 -07:00
Mike Perham
aec53975e3 Merge pull request #1674 from devaroop/master
Option to remove the generic aliases which MAY clash
2014-05-20 20:21:11 -07:00
Mike Perham
d8d3df9f2f Dont need to manually add app/workers to autoload_paths 2014-04-28 21:11:28 -07:00
Devaroop
e5687d7184 Removes the generic aliases which MAY clash with names of already declared by other applications 2014-04-24 19:41:05 +05:30
Rafael Mendonça França
499882d4d4 Use ActiveSupport.on_load hooks to extend rails components
Checking if the constant is define and including the extensions directly
in the base class will for the class to be loaded. This may cause these
components to be loaded before the time and be missconfigured if the
sidekiq railtie is loaded before the components railtie.

It is unlikely to happen but is better be safe.
2014-03-28 21:36:38 -03:00
Sean Doyle
e12bf878fa Replaced class and instance level send
Replaced with `__send__` from std lib

* `send` can now be overridden to be more semantically meaningful
  * `message.send(user_id)` as opposed to `message.send_message(user_id)`
* `__send__` makes it clear that the reflective version is intended
2014-02-14 09:43:34 -05:00
Mike Perham
b0fa69a915 Remove optionality of Rails hooks, #401 2012-09-20 20:04:25 -07:00
Mike Perham
e55979407a Add extension to delay any arbitrary class method to Sidekiq. 2012-08-16 16:43:01 -07:00
Jon Hinson
f15ceb93c5 Renaming hook_rails option to enable_rails_extensions 2012-03-26 18:05:33 -05:00
Jon Hinson
cd423f9cdc Add hook_rails configuration option to make the Rails extensions optional 2012-03-26 15:37:38 -05:00
Mike Perham
65bf77217b Fix require ordering causing extensions to not load properly, GH-77. 2012-03-10 12:30:15 -08:00
Mike Perham
2771a0ad96 Rename workers to processors. New Railtie support.
Workers are the user's classes, the threads are now called processors.  Add secret sauce to make Rails config much easier.  Use a railtie to auto-add app/workers to the autoload path.
2012-01-25 13:32:51 -08:00