python-pq 0.6.1__tar.gz → 0.6.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (23) hide show
  1. {python_pq-0.6.1 → python_pq-0.6.3}/PKG-INFO +1 -1
  2. {python_pq-0.6.1 → python_pq-0.6.3}/pyproject.toml +1 -1
  3. {python_pq-0.6.1 → python_pq-0.6.3}/src/pq/__init__.py +1 -1
  4. {python_pq-0.6.1 → python_pq-0.6.3}/src/pq/client.py +5 -3
  5. {python_pq-0.6.1 → python_pq-0.6.3}/LICENSE +0 -0
  6. {python_pq-0.6.1 → python_pq-0.6.3}/README.md +0 -0
  7. {python_pq-0.6.1 → python_pq-0.6.3}/src/pq/config.py +0 -0
  8. {python_pq-0.6.1 → python_pq-0.6.3}/src/pq/logging.py +0 -0
  9. {python_pq-0.6.1 → python_pq-0.6.3}/src/pq/migrations/README +0 -0
  10. {python_pq-0.6.1 → python_pq-0.6.3}/src/pq/migrations/__init__.py +0 -0
  11. {python_pq-0.6.1 → python_pq-0.6.3}/src/pq/migrations/env.py +0 -0
  12. {python_pq-0.6.1 → python_pq-0.6.3}/src/pq/migrations/script.py.mako +0 -0
  13. {python_pq-0.6.1 → python_pq-0.6.3}/src/pq/migrations/versions/20260109T055839Z_476683af098d_initial_schema.py +0 -0
  14. {python_pq-0.6.1 → python_pq-0.6.3}/src/pq/migrations/versions/20260109T063747Z_2483bec70083_add_client_id.py +0 -0
  15. {python_pq-0.6.1 → python_pq-0.6.3}/src/pq/migrations/versions/20260205T120000Z_a1b2c3d4e5f6_add_max_concurrent.py +0 -0
  16. {python_pq-0.6.1 → python_pq-0.6.3}/src/pq/migrations/versions/20260205T180000Z_b7c8d9e0f1a2_add_periodic_key.py +0 -0
  17. {python_pq-0.6.1 → python_pq-0.6.3}/src/pq/migrations/versions/20260217T120000Z_c3d4e5f6a7b8_add_periodic_active.py +0 -0
  18. {python_pq-0.6.1 → python_pq-0.6.3}/src/pq/migrations/versions/__init__.py +0 -0
  19. {python_pq-0.6.1 → python_pq-0.6.3}/src/pq/models.py +0 -0
  20. {python_pq-0.6.1 → python_pq-0.6.3}/src/pq/priority.py +0 -0
  21. {python_pq-0.6.1 → python_pq-0.6.3}/src/pq/registry.py +0 -0
  22. {python_pq-0.6.1 → python_pq-0.6.3}/src/pq/serialization.py +0 -0
  23. {python_pq-0.6.1 → python_pq-0.6.3}/src/pq/worker.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-pq
3
- Version: 0.6.1
3
+ Version: 0.6.3
4
4
  Summary: Postgres-backed job queue for Python
5
5
  Keywords: postgres,job-queue,task-queue,background-jobs,worker
6
6
  Author: ricwo
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "python-pq"
3
- version = "0.6.1"
3
+ version = "0.6.3"
4
4
  description = "Postgres-backed job queue for Python"
5
5
  readme = "README.md"
6
6
  authors = [
@@ -5,7 +5,7 @@ from pq.models import Periodic, Task, TaskStatus
5
5
  from pq.priority import Priority
6
6
  from pq.worker import PostExecuteHook, PreExecuteHook, TaskTimeoutError
7
7
 
8
- __version__ = "0.6.1"
8
+ __version__ = "0.6.3"
9
9
 
10
10
  __all__ = [
11
11
  "PQ",
@@ -352,17 +352,19 @@ class PQ:
352
352
  result = session.execute(stmt)
353
353
  return result.rowcount > 0
354
354
 
355
- def unschedule(self, task: Callable[..., Any], *, key: str = "") -> bool:
355
+ def unschedule(self, task: Callable[..., Any] | str, *, key: str = "") -> bool:
356
356
  """Remove a periodic task.
357
357
 
358
358
  Args:
359
- task: The scheduled function to remove.
359
+ task: The scheduled function to remove, or its import path
360
+ as a 'module:name' string (useful when the module has
361
+ been removed and the callable is no longer importable).
360
362
  key: Discriminator key. Defaults to "" (the default schedule).
361
363
 
362
364
  Returns:
363
365
  True if task was found and deleted, False otherwise.
364
366
  """
365
- name = get_function_path(task)
367
+ name = task if isinstance(task, str) else get_function_path(task)
366
368
  with self.session() as session:
367
369
  stmt = delete(Periodic).where(Periodic.name == name, Periodic.key == key)
368
370
  result = session.execute(stmt)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes