Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/sentry/options/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -1702,6 +1702,12 @@
default=False,
flags=FLAG_AUTOMATOR_MODIFIABLE,
)
# Overrides modified date and always updates the row. Can be removed if not needed later.
register(
"on_demand.update_on_demand_modified",
default=False,
flags=FLAG_AUTOMATOR_MODIFIABLE,
)

register(
"delightful_metrics.minimetrics_sample_rate",
Expand Down
6 changes: 6 additions & 0 deletions src/sentry/tasks/on_demand_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import sentry_sdk
from celery.exceptions import SoftTimeLimitExceeded
from django.utils import timezone

from sentry import options
from sentry.api.utils import get_date_range_from_params
Expand Down Expand Up @@ -295,6 +296,11 @@ def _set_widget_on_demand_state(
if on_demand.can_extraction_be_auto_overridden():
on_demand.extraction_state = extraction_state

if options.get("on_demand.update_on_demand_modified"):
# Only temporarily required to check we've updated data on rows the task has passed
# Or updated to pass the check against widget query date_modified.
on_demand.date_modified = timezone.now()

on_demand.spec_hashes = spec_hashes
on_demand.save()

Expand Down