Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENG-6266][ENG-6241] send monthly usage to trove as supplementary metadata #10764

Merged
Prev Previous commit
Next Next commit
allow a followup_task on MonthlyReporter
aaxelb committed Oct 21, 2024
commit b5dcd364e3f2ba99910bba4be69cda8a4edc01b4
3 changes: 3 additions & 0 deletions osf/management/commands/monthly_reporters_go.py
Original file line number Diff line number Diff line change
@@ -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):
3 changes: 3 additions & 0 deletions osf/metrics/reporters/_base.py
Original file line number Diff line number Diff line change
@@ -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):