Skip to content

Commit f04c662

Browse files
authored
finalize endpoints before dispatching async tasks (#137)
* finalize endpoints before dispatching async tasks * changelog and bumpversion
1 parent 0ab00ce commit f04c662

File tree

5 files changed

+9
-4
lines changed

5 files changed

+9
-4
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 0.31.3
2+
current_version = 0.31.4
33

44
[bumpversion:file:pyproject.toml]
55

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
# [0.31.4] - 2023-10-12
8+
- [PR 137](https://github.com/salesforce/django-declarative-apis/pull/137) Finalize endpoints before dispatching async tasks
9+
710
# [0.31.3] - 2023-09-30
811
- [PR 136](https://github.com/salesforce/django-declarative-apis/pull/136) Fix filter expansion for pydantic objects
912

django_declarative_apis/machinery/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,9 @@ def get_response(self): # noqa: C901
265265
if resource and resource.is_dirty(check_relationship=True):
266266
update_dirty(resource)
267267

268+
# all synchronous tasks are done, finalize the endpoint before launching async tasks
269+
self.bound_endpoint.finalize()
270+
268271
for deferred_task in deferred_tasks:
269272
deferred_task.run(self.bound_endpoint)
270273

@@ -449,7 +452,6 @@ def process_request_and_get_response(self, request, *args, **kwargs):
449452
bound_endpoint.bound_endpoint.__class__.__name__,
450453
)
451454
result = bound_endpoint.get_response()
452-
bound_endpoint.bound_endpoint.finalize()
453455
return result
454456
except errors.ApiError:
455457
raise

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
# built documents.
7575

7676
# The full version, including alpha/beta/rc tags.
77-
release = '0.31.3' # set by bumpversion
77+
release = '0.31.4' # set by bumpversion
7878

7979
# The short X.Y version.
8080
version = release.rsplit('.', 1)[0]

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "django-declarative-apis"
7-
version = "0.31.3" # set by bumpversion
7+
version = "0.31.4" # set by bumpversion
88
description = "Simple, readable, declarative APIs for Django"
99
readme = "README.md"
1010
dependencies = [

0 commit comments

Comments
 (0)