From 01515b16e711b986dd6916f229c64bd0c9fd3c2f Mon Sep 17 00:00:00 2001 From: Sebastian Molenda Date: Mon, 26 Feb 2024 09:39:08 +0100 Subject: [PATCH 1/2] Fix AsyncioTelemetryManager to avoid creating a task every second --- pubnub/pubnub_asyncio.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/pubnub/pubnub_asyncio.py b/pubnub/pubnub_asyncio.py index d47eb40c..14c83eec 100644 --- a/pubnub/pubnub_asyncio.py +++ b/pubnub/pubnub_asyncio.py @@ -794,14 +794,18 @@ async def wait_for_presence_on(self, *channel_names): class AsyncioTelemetryManager(TelemetryManager): def __init__(self): TelemetryManager.__init__(self) - self._timer = AsyncioPeriodicCallback( - self._start_clean_up_timer, - self.CLEAN_UP_INTERVAL * self.CLEAN_UP_INTERVAL_MULTIPLIER, - asyncio.get_event_loop()) - self._timer.start() + self.loop = asyncio.get_event_loop() + self._schedule_next_cleanup() - async def _start_clean_up_timer(self): + def _schedule_next_cleanup(self): + self._timer = self.loop.call_later( + self.CLEAN_UP_INTERVAL * self.CLEAN_UP_INTERVAL_MULTIPLIER / 1000, + self._clean_up_schedule_next + ) + + def _clean_up_schedule_next(self): self.clean_up_telemetry_data() + self._schedule_next_cleanup() def _stop_clean_up_timer(self): - self._timer.stop() + self._timer.cancel() From 486a5421bb0a0e1ceddd9c8c0c0bbd6cde818803 Mon Sep 17 00:00:00 2001 From: PubNub Release Bot <120067856+pubnub-release-bot@users.noreply.github.com> Date: Mon, 26 Feb 2024 14:08:04 +0000 Subject: [PATCH 2/2] PubNub SDK v7.4.1 release. --- .pubnub.yml | 13 +++++++++---- CHANGELOG.md | 6 ++++++ pubnub/pubnub_core.py | 2 +- setup.py | 2 +- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/.pubnub.yml b/.pubnub.yml index 189b92ae..830a3fa0 100644 --- a/.pubnub.yml +++ b/.pubnub.yml @@ -1,5 +1,5 @@ name: python -version: 7.4.0 +version: 7.4.1 schema: 1 scm: github.com/pubnub/python sdks: @@ -18,7 +18,7 @@ sdks: distributions: - distribution-type: library distribution-repository: package - package-name: pubnub-7.4.0 + package-name: pubnub-7.4.1 location: https://pypi.org/project/pubnub/ supported-platforms: supported-operating-systems: @@ -97,8 +97,8 @@ sdks: - distribution-type: library distribution-repository: git release - package-name: pubnub-7.4.0 - location: https://github.com/pubnub/python/releases/download/v7.4.0/pubnub-7.4.0.tar.gz + package-name: pubnub-7.4.1 + location: https://github.com/pubnub/python/releases/download/v7.4.1/pubnub-7.4.1.tar.gz supported-platforms: supported-operating-systems: Linux: @@ -169,6 +169,11 @@ sdks: license-url: https://github.com/aio-libs/aiohttp/blob/master/LICENSE.txt is-required: Required changelog: + - date: 2024-02-26 + version: v7.4.1 + changes: + - type: bug + text: "Fixes AsyncioTelemetryManager to avoid creating a task every second." - date: 2024-02-08 version: v7.4.0 changes: diff --git a/CHANGELOG.md b/CHANGELOG.md index 175054ce..6f5a5016 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## v7.4.1 +February 26 2024 + +#### Fixed +- Fixes AsyncioTelemetryManager to avoid creating a task every second. + ## v7.4.0 February 08 2024 diff --git a/pubnub/pubnub_core.py b/pubnub/pubnub_core.py index d6ef1a10..d51edc0c 100644 --- a/pubnub/pubnub_core.py +++ b/pubnub/pubnub_core.py @@ -85,7 +85,7 @@ class PubNubCore: """A base class for PubNub Python API implementations""" - SDK_VERSION = "7.4.0" + SDK_VERSION = "7.4.1" SDK_NAME = "PubNub-Python" TIMESTAMP_DIVIDER = 1000 diff --git a/setup.py b/setup.py index 60d39266..ec2eee7b 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='pubnub', - version='7.4.0', + version='7.4.1', description='PubNub Real-time push service in the cloud', author='PubNub', author_email='support@pubnub.com',