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

15 commits

Author SHA1 Message Date
Mike Perham
29dca70e24
Introduce Sidekiq::Capsule (#5487)
* Initial work on Sidekiq::Config

* Initial work on Sidekiq::Config

* reduce dependencies in deploy marks

* bare sidekiq and webapp

* Modify runtime to work with Capsules

* Cleanup

* Rename test files to remove test_ prefix

* Update test suite and standard rules to be more compliant

* Move constant definition outside code, per standard formatting

* Loads of changes for introduction of Capsules

* Remove Redis adapter abstraction

* update capsule overview

* Ensure Sidekiq.redis uses the correct pool for jobs running within a Capsule

* Use default_capsule for safety

* Slow down the beat to halve its Redis overhead

* move config fixtures into cfg/

* Add capsule middleware test

* use accessor
2022-08-25 10:15:11 -07:00
Mike Perham
2ee7e27697 merge 6.5 2022-06-09 14:06:33 -07:00
Mike Perham
67daa7a408
Prepare for upcoming Sidekiq::Config redesign (#5340)
* 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
b9d4d8ecb8 remove deprecated apis, enable new defaults 2022-05-13 14:56:26 -07:00
Mike Perham
fdfb7a5211 A bit more polish for the API, #5291 2022-05-06 13:52:38 -07:00
Mike Perham
a8c4966cdc Move payload json verification after middleware, fixes #5246 2022-03-17 10:42:33 -07:00
Mike Perham
ba557da4f4 Refactor recent client changes
I find `push` is easier to read this way. push_bulk is quite complex and adds a net-negative layer of abstraction.
2022-03-14 12:16:15 -07:00
Rahul Agrawal
10598b5206
Surface exact job class name in complex argument error message (#5235)
* Surface exact job class name in complex argument error message

* Update job_util.rb

* Update param for ActiveJob arg serialization failure

Co-authored-by: Mike Perham <mperham@gmail.com>
2022-03-09 11:36:32 -08:00
Mike Perham
e7d154eeb5 Remove "worker" from codebase where possible 2022-03-03 12:37:25 -08:00
Adam Niedzielski
7cd97b4253
Remove parallel code paths caused by "push" and "push_bulk" (#5182)
* Remove parallel code paths caused by "push" and "push_bulk"

Fixes #5158

* Refactor where jid is generated

* Hardcode client class

* Make generate_jid private

* Build client outside the loop
2022-02-15 17:14:45 -08:00
Mike Perham
63f6e68777 standard formatting 2022-01-05 21:01:32 -08:00
Mike Perham
cea266a72f Better method naming, #5071 2022-01-05 19:54:12 -08:00
Mike Perham
b0fd83f5fc Rejigger complex argument handling, #5071
Add job class name to arg message
2021-12-07 13:58:04 -08:00
Kelly Sutton
fde53a5fc1
Implement strict argument checking (#5071)
* Add the outline of failing tests

* Implement argument checking

* Move argument checking into Sidekiq::JobUtil#validate

* Refactor acceptable class definition into a constant to cut down on array allocations

* Improve error message, match raise call formatting to other errors in the class

* Address feedback in the Pull Request to use the JSON round-trip method
of confirming the safety of job argument payloads.

Cleanup commented-out code from a few years back.

Co-authored-by: Eda Zhou <eda.zhou@gusto.com>

* Swap out JSON.load for JSON.parse per the security CI check

Co-authored-by: Eda Zhou <eda.zhou@gusto.com>

* Add a few more tests cases to build up confidence around our JSON.parse/dump approach and deep structures

Co-authored-by: Eda Zhou <eda.zhou@gusto.com>

* Improve test case description

* Warn when job arguments do not serialize safely and point folks toward how to enable strict_mode and the best practice

* Reconfigure the options-hash based approach to a global Sidekiq.strict_mode! method

* Add a note in the raised error on how to disable the error

* Let the error message breathe a little bit

* Toggle strict_mode! off to suss out a test flake

* Capitalize the start of a sentence

* Rename job_is_json_safe to json_safe?

Co-authored-by: Eda Zhou <eda.zhou@gusto.com>

* Refactor a few tests to test a single argument at a time

Co-authored-by: Eda Zhou <eda.zhou@gusto.com>

* Break out test cases to exercise each individual intersting case instead of all at once

Co-authored-by: Eda Zhou <eda.zhou@gusto.com>

* Change formatting to be more consistent, tighter when arguments are simple

Co-authored-by: Eda Zhou <eda.zhou@gusto.com>

* Add a flag to disable the warning message for development warning messages

Co-authored-by: Eda Zhou <eda.zhou@gusto.com>

Co-authored-by: Eda Zhou <eda.zhou@gusto.com>
2021-12-07 13:20:20 -08:00
Mike Perham
6ae5b02236 Extract client's job utility methods, use them for perform_inline.
Sidekiq::Client is Redis-only, no inline support.
2021-11-16 10:15:14 -08:00