open-lms-open-source / moodle-local_redislock

6 stars 17 forks source link

Make retry timeout configurable #13

Open fabianfreyer opened 3 years ago

fabianfreyer commented 3 years ago

Instead of hardcoding the sleep timeouts between 0.5 and 1 second, make these configurable using the $CFG->local_redislock_retry_timeout and $CFG->local_redislock_retry_jitter configuration variables, which default to the currently hardcoded limits.

cc @naderman

dvdcastro commented 3 years ago

Unit tests are failing locally for me.

vendor/bin/phpunit local/redislock/tests/redis_lock_factory_test.php
Failed asserting that a boolean is not empty.
 /vagrant/www/moodle/local/redislock/tests/redis_lock_factory_test.php:134
 /vagrant/www/moodle/lib/phpunit/classes/advanced_testcase.php:91

Failed asserting that a boolean is not empty.
 /vagrant/www/moodle/local/redislock/tests/redis_lock_factory_test.php:156
 /vagrant/www/moodle/lib/phpunit/classes/advanced_testcase.php:91

Can you please verify?