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

48 commits

Author SHA1 Message Date
Mike Perham
67daa7a408
Prepare for upcoming Sidekiq::Config redesign ()
* Prepare for upcoming Sidekiq::Config redesign

Adjust the server internals to use a config object rather than refering directly to the Sidekiq module.
2022-05-31 13:37:31 -07:00
Mike Perham
5776c7ae87 standard:fix the testsuite codebase, no functional changes 2022-03-03 12:51:10 -08:00
Eugene Kenny
d9cc977f1a
Allow middleware to yield arguments ()
The arguments are always ignored, but this allows the block to be passed
to a method that yields arguments:

    class TaggedLoggingMiddleware
      def call(*, &block)
        Rails.logger.tagged("my cool job", &block)
      end
    end
2020-08-25 09:26:42 -07:00
Mike Perham
fce05c9d4b
Fetch API refactor, WIP ()
* Fetch API refactor, WIP

* save options for later

* changes

* Fix test failures
2020-06-19 08:39:18 -07:00
Mike Perham
85a1be3684 Switch all tests to use Minitest::Spec for consistency 2019-02-28 12:43:50 -08:00
Andrew Babichev
ea9b34a953 Add CLI Run Test - Write Pid, System Boot, Print Banner ()
* Add appraisal

* Test CLI run (write pid, system boot, print banner)

* Cleanup test helper

* Set REDIS_URL to use non-default host in test env

* Move mintiest-focus to test bundle group
2018-12-07 08:59:42 -08:00
Andrew Babichev
ddb0c8b3a8 Cleanup CLI ()
* Refactor CLI test

Extracted 3 main parts:
- parse
- run
- signal handling

* Move demonization and pid write from parse to run phase

* Move queues default from validate to setup options phase

* Add pry-byebug gem

* Drop Sidekiq::Test

* Require launcher in CLI

* Remove TODOs
2018-12-03 13:24:37 -08:00
Alfonso Uceda Pompa
c02862bd97 Custom job_logger_class 2017-06-07 10:20:31 -07:00
Mike Perham
701e06224c Rework job processing in light of Rails 5's Reloader ()
* Rework job processing in light of Rails 5's Reloader, see 

* Ignore built gems

* Documentation, testing

* Add fallback for 'retry' value server-side, fixes 

* Fix job hash reporting in stats

* cleanup

* Add job for AJ testing

* Push jobs with invalid JSON immediately to Dead set, fixes 

* Break retry logic into global and local parts, fixes 

* fix heisentest
2017-01-17 14:58:08 -08:00
Mike Perham
b8f7082642 Fix minitest warnings ()
* Fix minitest deprecations, fixes 

* fix jruby

* test against jruby release

* ugh

* bump to 5.0.1

* fix test
2017-01-02 12:06:02 -08:00
Mike Perham
2c9f7662fc Freeze all string literals in source, fixes
Tests pass and smoke test works perfectly.
2015-12-31 15:33:35 -08:00
Mike Perham
da02fcb6a7 Cleanup, tests passing 2015-10-08 09:37:37 -07:00
Mike Perham
48546fdae9 WIP manager and launcher 2015-10-06 12:43:01 -07:00
grosser
57a06d00d6 allow every test to be run with just ruby test/xxx_test.rb 2014-12-30 12:54:58 -08:00
Abdelkader Boudih
c0bf21a8b3 Introduce chain#prepend possible fix for 2014-10-28 18:10:09 +00:00
Mike Perham
83aea0690e Explicitly pass Redis associated with this job
When pushing a job, the middleware should be able to access the Redis instance associated with that job.  Previously, Sidekiq was limited to one global Redis instance.  Now that we want to support sharding, we have to explicitly pass the instance in OR hack up APIs with thread local variables.  Explicit is better.
2014-03-25 21:38:17 -07:00
Mike Perham
766a86add6 Stupid jerk bossy i18n gem 2014-03-12 13:07:29 -07:00
Tobias Maier
37a576aa91 Fix for Ruby 1.9 2014-01-01 23:37:28 +01:00
Tobias Maier
67f8adf5ae Add test for I18n.enforce_available_locales = true for I18n middleware 2014-01-01 23:32:09 +01:00
Kevin Bedell
5a7c52e8e9 fix issues with jruby failing tests 2013-11-12 15:54:16 -05:00
Mike Perham
babfdc96c5 Backport test suite to Minitest 4 so we can test against Rails 4. 2013-09-22 14:38:33 -07:00
David Czarnecki
3f0d7e32a4 Allow for default number of retry attempts to be set for RetryJobs middleware.
* Adds `max_retries` option to RetryJobs middleware. Default is still 25. This
  way you can still retry jobs, but not have it spread out over such a long
  period.

Modify `Sidekiq::Middleware::Chain#add` semantics

* If middleware class already exists in the chain, remove the
  existing class and add it with possibly new arguments.
2013-08-01 16:23:50 -04:00
Mike Perham
06acbd4f60 Avoid calling processor during hard shutdown, fixes 2013-06-10 22:20:15 -07:00
Mike Perham
4679c95f49 Upgrade to Minitest 5 2013-05-12 14:25:30 -07:00
Mike Perham
fe57c7d6dd Add i18n middleware, fixes 2013-03-03 16:20:01 -08:00
Mike Perham
7408387ee0 Refactor fetch strategy, fix queueing to lpush and rpop. 2013-01-05 21:17:08 -08:00
Jack Royal-Gordon
71931fc0e1 Change #add_before and #add_after to #insert_before and #insert_after 2012-12-19 08:40:36 -08:00
Jack Royal-Gordon
7b5c3b02cb Add chain#add_before and chain#add_after to facilitate insertion into the middle of the Middleware chains. 2012-12-18 21:42:23 -08:00
Mike Perham
110cc1dc42 Update Celluloid API usage, use .async, fixes 2012-11-03 19:56:06 -07:00
Tyson Tate
08f54d1e11 Remove unused variables in tests. 2012-10-30 23:26:32 -07:00
Mike Subelsky
0622ac3192 extract error handling middleware into processor-level code 2012-07-31 14:30:34 -04:00
Mike Perham
d47873a4d9 remove old middleware testing 2012-07-20 20:14:32 -07:00
Mike Perham
7a45208cf0 Defer loading message JSON until a full stack is available. 2012-06-21 20:51:47 -07:00
Mike Perham
8adba07887 Simplify middleware testing 2012-03-17 17:59:18 -07:00
Mike Perham
5ec8ac08b0 Test suite cleanup 2012-03-17 13:32:52 -07:00
Mike Perham
2206ce7654 RedisConnection was only ever creating one Redis connection, even when pooled. Oops. 2012-03-13 21:19:46 -07:00
Mike Perham
0973245909 Redis connection API change
old: Sidekiq.redis = Sidekiq::RedisConnection.create(:namespace => 'foo')
new: Sidekiq.redis = { :namespace => 'foo' }
2012-03-01 13:41:12 -08:00
Mike Perham
6af6a86369 Refactor middleware API, this will break anyone using the old API.
e.g.
Sidekiq::Processor.middleware => Sidekiq.server_middleware
Sidekiq::Client.middleware => Sidekiq.client_middleware
2012-02-18 12:12:05 -08:00
Mike Perham
00501031df One redis accessor to rule them all. 2012-02-17 13:39:36 -08:00
Mike Perham
f9af66edd7 Rework redis connections so that the manager and
the client use separate pools.

This is so the Rails app Sidekiq::Client and 
Sidekiq::Manager can use different configurations.

Also, fix issue where workers were not unregistered
in Redis upon shutdown.
2012-02-11 13:14:03 -08:00
Mike Perham
23651d5196 First pass at Resque-compatible processing stats 2012-02-10 23:16:12 -08:00
Mike Perham
fd46c5471a Client workers can now define associated queue
Configure client middleware chain by default
Middleware entries should be unique
Change client#push to return boolean based on pushed or not.
2012-02-10 20:20:01 -08:00
Mike Perham
f89eedf326 Add new sidekiq/testing feature.
This makes job processing synchronous when required.
2012-02-09 21:46:44 -08:00
Mike Perham
a1f78816a7 Implement generic Ruby support via simple require flag
Various cleanups
It's "assert_equal(expected, actual)"
2012-02-09 20:32:59 -08:00
Ryan LeCompte
2399d13dbb add tests for non-yielding middleware 2012-02-08 17:28:12 -08:00
Ryan LeCompte
c3609d6d48 refactor middleware into client/server layers 2012-02-08 17:04:02 -08:00
Ryan LeCompte
1a028c4a2f introduce middleware for cleanup of encoded payloads 2012-02-07 17:18:28 -08:00
Ryan LeCompte
144bc904cf rework how middleware chain is invoked, add middleware tests and cleanup 2012-02-04 21:45:34 -08:00