Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add seconds option to interval_units with tests #29

Closed
wants to merge 23 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
83cc432
add seconds option to interval_units with tests
Oct 10, 2018
f7952f2
pinning rq-scheduler to avoid redis version 3
Jan 10, 2019
5506b97
add seconds option to interval_units with tests
Oct 10, 2018
70b2928
Proposed handling of intervals in seconds.
tom-price May 26, 2019
f1ae05b
Merge pull request #1 from istrategylabs/master
rmartin48 Sep 20, 2019
37a8125
updating dependancies
Sep 20, 2019
cbd6d13
Merge pull request #1 from tom-price/seconds_interval_units
mattjegan Mar 6, 2020
7dd8cfc
Merge pull request #2 from isl-x/master
mattjegan Mar 9, 2020
98ba903
add django3 compat
Mar 9, 2020
5225664
force version bump
Mar 9, 2020
ae0a7fc
bump version
Mar 9, 2020
cc4d7ff
Update setuptools
Sep 2, 2020
8af3c14
Update pytz
Sep 2, 2020
7cbc198
Merge remote-tracking branch 'remotes/upstream/master' into seconds_i…
tom-price Sep 17, 2020
861c1ab
Fixed duplicate migration and added disclaimer to README.md
tom-price Sep 17, 2020
a3ac34b
Merge branch 'seconds_option_pr_29' into seconds_interval_units
tom-price Sep 17, 2020
6755a71
Update setup.py
mattjegan Dec 1, 2020
253bf73
Merge remote-tracking branch 'isl-x/master' into isl-x-merge
Mar 24, 2021
5346014
Merge pull request #3 from divipayhq/isl-x-merge
rmartin48 Mar 24, 2021
f4eea05
Merge branch 'master' into master
mattjegan Jul 14, 2021
6867fce
Merge pull request #4 from divipayhq/master
mattjegan Jul 14, 2021
2c237c8
Merge pull request #3 from tom-price/seconds_interval_units
mattjegan Jul 14, 2021
b2df29a
Update models.py
mattjegan Jul 14, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,7 @@ target/

# SQLite
*.sqlite3

# Pipenv
Pipfile
Pipfile.lock
18 changes: 18 additions & 0 deletions scheduler/migrations/0006_auto_20181010_0102.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 2.1.2 on 2018-10-10 01:02

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('scheduler', '0005_added_result_ttl'),
]

operations = [
migrations.AlterField(
model_name='repeatablejob',
name='interval_unit',
field=models.CharField(choices=[('seconds', 'seconds'), ('minutes', 'minutes'), ('hours', 'hours'), ('days', 'days'), ('weeks', 'weeks')], default='hours', max_length=12, verbose_name='interval unit'),
),
]
1 change: 1 addition & 0 deletions scheduler/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ class Meta:
class RepeatableJob(ScheduledTimeMixin, BaseJob):

UNITS = Choices(
('seconds', _('seconds')),
('minutes', _('minutes')),
('hours', _('hours')),
('days', _('days')),
Expand Down
6 changes: 6 additions & 0 deletions scheduler/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,12 @@ def test_interval_seconds_minutes(self):
job.interval_unit = 'minutes'
self.assertEqual(900.0, job.interval_seconds())

def test_interval_seconds_seconds(self):
job = RepeatableJob()
job.interval = 15
job.interval_unit = 'seconds'
self.assertEqual(15.0, job.interval_seconds())

def test_repeatable_schedule(self):
job = self.JobClassFactory()
job.id = 1
Expand Down