Skip to content

Commit

Permalink
remove pagesize for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
jsjiang committed Aug 1, 2024
1 parent 29b8716 commit 8e5a019
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion ezidapp/management/commands/proc-link-checker-update.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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")
Expand All @@ -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

0 comments on commit 8e5a019

Please sign in to comment.