Skip to content

Commit 12e0ab3

Browse files
authored
[DBMON-5558] Fix deprecation warnings on isSet() (DataDog#20947)
* Fix deprecation warnings on isSet() * Add changelog
1 parent 7185b0b commit 12e0ab3

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixes deprecation warnings on isSet() usage in DBMAsyncJob

datadog_checks_base/datadog_checks/base/utils/db/utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ def _job_loop(self):
334334
try:
335335
self._log.info("[%s] Starting job loop", self._job_tags_str)
336336
while True:
337-
if self._cancel_event.isSet():
337+
if self._cancel_event.is_set():
338338
self._log.info("[%s] Job loop cancelled", self._job_tags_str)
339339
self._check.count("dd.{}.async_job.cancel".format(self._dbms), 1, tags=self._job_tags, raw=True)
340340
break
@@ -353,7 +353,7 @@ def _job_loop(self):
353353
else:
354354
self._run_job_rate_limited()
355355
except Exception as e:
356-
if self._cancel_event.isSet():
356+
if self._cancel_event.is_set():
357357
# canceling can cause exceptions if the connection is closed the middle of the check run
358358
# in this case we still want to report it as a cancellation instead of a crash
359359
self._log.debug("[%s] Job loop error after cancel: %s", self._job_tags_str, e)
@@ -400,7 +400,7 @@ def _run_job_rate_limited(self):
400400
except:
401401
raise
402402
finally:
403-
if not self._cancel_event.isSet():
403+
if not self._cancel_event.is_set():
404404
self._rate_limiter.update_last_time_and_sleep()
405405
else:
406406
self._rate_limiter.update_last_time()

0 commit comments

Comments
 (0)