Skip to content

Commit

Permalink
fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
cardinam committed Feb 13, 2024
1 parent eb88cc9 commit 52ce49e
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 26 deletions.
1 change: 0 additions & 1 deletion taskq/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

initial = True

dependencies = []
Expand Down
1 change: 0 additions & 1 deletion taskq/migrations/0002_add_retry_delay.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


class Migration(migrations.Migration):

dependencies = [("taskq", "0001_initial")]

operations = [
Expand Down
1 change: 0 additions & 1 deletion taskq/migrations/0003_make_retry_delay_nonnullable.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


class Migration(migrations.Migration):

dependencies = [("taskq", "0002_add_retry_delay")]

operations = [
Expand Down
1 change: 0 additions & 1 deletion taskq/migrations/0004_modify_max_retries_default.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


class Migration(migrations.Migration):

dependencies = [("taskq", "0003_make_retry_delay_nonnullable")]

operations = [
Expand Down
1 change: 0 additions & 1 deletion taskq/migrations/0005_fix_model_fields_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


class Migration(migrations.Migration):

dependencies = [("taskq", "0004_modify_max_retries_default")]

operations = [
Expand Down
1 change: 0 additions & 1 deletion taskq/migrations/0006_auto_20190705_0601.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


class Migration(migrations.Migration):

dependencies = [("taskq", "0005_fix_model_fields_types")]

operations = [
Expand Down
1 change: 0 additions & 1 deletion taskq/migrations/0007_task_timeout.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

dependencies = [("taskq", "0006_auto_20190705_0601")]

operations = [
Expand Down
1 change: 0 additions & 1 deletion taskq/migrations/0008_alter_task_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

dependencies = [("taskq", "0007_task_timeout")]

operations = [
Expand Down
13 changes: 8 additions & 5 deletions taskq/migrations/0009_use_jsonfield_for_function_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,18 @@


class Migration(migrations.Migration):

dependencies = [
('taskq', '0008_alter_task_status'),
("taskq", "0008_alter_task_status"),
]

operations = [
migrations.AlterField(
model_name='task',
name='function_args',
field=models.JSONField(decoder=taskq.json.JSONDecoder, default=dict, encoder=taskq.json.JSONEncoder),
model_name="task",
name="function_args",
field=models.JSONField(
decoder=taskq.json.JSONDecoder,
default=dict,
encoder=taskq.json.JSONEncoder,
),
),
]
18 changes: 9 additions & 9 deletions taskq/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,18 @@ def apply_async(
kwargs=None,
):
"""Apply a task asynchronously.
.
:param Tuple args: The positional arguments to pass on to the task.
.
:param Tuple args: The positional arguments to pass on to the task.
:parm Dict kwargs: The keyword arguments to pass on to the task.
:parm Dict kwargs: The keyword arguments to pass on to the task.
:parm due_at: When the task should be executed. (None = now).
:type due_at: timedelta or None
:parm due_at: When the task should be executed. (None = now).
:type due_at: timedelta or None
:param timeout: The maximum time a task may run.
(None = no timeout)
(int = number of seconds)
:type timeout: timedelta or int or None
:param timeout: The maximum time a task may run.
(None = no timeout)
(int = number of seconds)
:type timeout: timedelta or int or None
"""

if due_at is None:
Expand Down
4 changes: 1 addition & 3 deletions tests/test_consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ def test_consumer_db_error(self):
tasks = [create_task() for _ in range(task_count)]

with self.assertLogs("taskq", level="ERROR") as taskq_error_logger_check:

with patch.object(Task, "save", autospec=True) as mock_task_save:
running_tasks = set()
error_task = None
Expand Down Expand Up @@ -280,8 +279,7 @@ def test_consumer_taskq_fetched_tasks_count_logging_threshold_counter_reset(self
}
)
def test_consumer_create_task_for_due_scheduled_task(self):
"""Consumer creates tasks for each scheduled task defined in settings.
"""
"""Consumer creates tasks for each scheduled task defined in settings."""
consumer = Consumer()

# Hack the due_at date to simulate the fact that the task was run once
Expand Down
1 change: 0 additions & 1 deletion tests/test_consumer_multiprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@


class ConsumerMultiProcessTestCase(TransactionTestCase):

# To run these tests, create_background_consumers uses threads.
# This is not compatible with current timeout implementation based on signals.
# Hence we force timeout at 0.
Expand Down

0 comments on commit 52ce49e

Please sign in to comment.