Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
This commit is contained in:
Marc 'risson' Schmitt
2025-03-27 14:35:16 +01:00
parent 0bc4b69f52
commit 2335a3130a
3 changed files with 6 additions and 6 deletions

View File

@ -356,7 +356,7 @@ class _PostgresConsumer(Consumer):
if not self.notifies:
self._poll_for_notify()
if not self.notifies and not randint(0, 300):
if not self.notifies and not randint(0, 300): # nosec
# If there aren't any more notifies, randomly poll for missed/crashed messages.
# Since this method is called every second, this condition limits polling to
# on average one SELECT every five minutes of inactivity.
@ -393,7 +393,7 @@ class _PostgresConsumer(Consumer):
def _auto_purge(self):
# Automatically purge messages on average every 100k iteration.
# Dramatiq defaults to 1s, so this means one purge every 28 hours.
if randint(0, 100_000):
if randint(0, 100_000): # nosec
return
self.logger.debug("Running garbage collector")
count = self.query_set.filter(

View File

@ -68,7 +68,7 @@ class Command(BaseCommand):
*tasks_modules,
]
os.execvp(executable_path, process_args)
os.execvp(executable_path, process_args) # nosec
def _resolve_executable(self, exec_name: str):
bin_dir = os.path.dirname(sys.executable)

View File

@ -1,4 +1,4 @@
import pickle
import pickle # nosec
import pglock
from django.db import router, transaction
@ -26,8 +26,8 @@ class Scheduler:
actor = self.broker.get_actor(schedule.actor_name)
actor.send_with_options(
args=pickle.loads(schedule.args),
kwargs=pickle.loads(schedule.kwargs),
args=pickle.loads(schedule.args), # nosec
kwargs=pickle.loads(schedule.kwargs), # nosec
options={
"schedule_uid": schedule.uid,
},