Skip to content

Commit

Permalink
fix: invoke followup task correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
aaxelb committed Nov 22, 2024
1 parent 4fcfa3b commit a8c046e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions osf/metrics/reporters/public_item_usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,15 @@ def report(self, **report_kwargs):
return None

def followup_task(self, report):
_is_last_month = report.yearmonth.next() == YearMonth.from_date(datetime.date.today())
_is_last_month = report.report_yearmonth.next() == YearMonth.from_date(datetime.date.today())
if _is_last_month:
from api.share.utils import task__update_share
return task__update_share.s(
report.item_osfid,
is_backfill=True,
osfmap_partition_name=OsfmapPartition.MONTHLY_SUPPLEMENT.name,
return task__update_share.signature(
args=(report.item_osfid,),
kwargs={
'is_backfill': True,
'osfmap_partition_name': OsfmapPartition.MONTHLY_SUPPLEMENT.name,
},
countdown=30, # give index time to settle
)

Expand Down

0 comments on commit a8c046e

Please sign in to comment.