From 8e5a0193fc2d1ddab9a3732470f3db5fbe78730d Mon Sep 17 00:00:00 2001 From: jsjiang Date: Thu, 1 Aug 2024 16:33:31 -0700 Subject: [PATCH] remove pagesize for testing --- .../commands/proc-link-checker-update.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/ezidapp/management/commands/proc-link-checker-update.py b/ezidapp/management/commands/proc-link-checker-update.py index eee56917..45d5ed00 100644 --- a/ezidapp/management/commands/proc-link-checker-update.py +++ b/ezidapp/management/commands/proc-link-checker-update.py @@ -73,6 +73,7 @@ def run(self): lc = next(lcGenerator) while si is not None: log.debug("Processing %s", si.identifier) + print("Processing %s", si.identifier) while lc is not None and lc.identifier < si.identifier: lc = next(lcGenerator) newValue = None @@ -86,6 +87,7 @@ def run(self): if newValue is not None: log.debug("Updating %s", si.identifier) + print("Updating %s", si.identifier) # Before updating the Identifier, we carefully lock # the table and ensure that the object still exists. try: @@ -120,7 +122,7 @@ def _sameTimeOfDayDelta(self): d += 86400 return d - def _harvest(self, model, only=None, filter=None): + def _harvest_org(self, model, only=None, filter=None): lastIdentifier = "" while not self.terminated(): qs = model.objects.filter(identifier__gt=lastIdentifier).order_by("identifier") @@ -138,3 +140,14 @@ def _harvest(self, model, only=None, filter=None): else: lastIdentifier = last_record.identifier yield None + + def _harvest(self, model, only=None, filter=None): + qs = model.objects.all().order_by("identifier") + if only is not None: + qs = qs.only(*only) + + for o in qs: + if filter is None or filter(o): + yield o + + yield None