Skip to content

Commit

Permalink
allow a followup_task on MonthlyReporter
Browse files Browse the repository at this point in the history
  • Loading branch information
aaxelb committed Oct 17, 2024
1 parent 6197161 commit 19cf2fb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions osf/management/commands/monthly_reporters_go.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ def monthly_reporter_go(task, reporter_key: str, yearmonth: str):
_reporter_class = AllMonthlyReporters[reporter_key].value
_reporter = _reporter_class(YearMonth.from_str(yearmonth))
_reporter.run_and_record_for_month()
_followup = _reporter.followup_task()
if _followup is not None:
_followup.apply_async()


class Command(BaseCommand):
Expand Down
3 changes: 3 additions & 0 deletions osf/metrics/reporters/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ def run_and_record_for_month(self) -> None:
report.report_yearmonth = self.yearmonth
report.save()

def followup_task(self) -> celery.Signature | None:
return None


class DailyReporter:
def report(self, report_date):
Expand Down

0 comments on commit 19cf2fb

Please sign in to comment.