Browse Source

refs(subscriptions): Make sure subscription tasks all accept `**kwargs` (#18925)

Currently, if we add extra parameters to these tasks we'll end up erroring on deploy. This is
because there can be workers running old code that doesn't expect extra params. `**kwargs` will
cause them to harmlessly drop any extra params that they can't handle.
Dan Fuller 4 years ago
parent
commit
ad7de7ce93
1 changed files with 3 additions and 3 deletions
  1. 3 3
      src/sentry/snuba/tasks.py

+ 3 - 3
src/sentry/snuba/tasks.py

@@ -28,7 +28,7 @@ def apply_dataset_conditions(dataset, conditions):
     default_retry_delay=5,
     max_retries=5,
 )
-def create_subscription_in_snuba(query_subscription_id):
+def create_subscription_in_snuba(query_subscription_id, **kwargs):
     """
     Task to create a corresponding subscription in Snuba from a `QuerySubscription` in
     Sentry. We store the snuba subscription id locally on success.
@@ -57,7 +57,7 @@ def create_subscription_in_snuba(query_subscription_id):
     default_retry_delay=5,
     max_retries=5,
 )
-def update_subscription_in_snuba(query_subscription_id):
+def update_subscription_in_snuba(query_subscription_id, **kwargs):
     """
     Task to update a corresponding subscription in Snuba from a `QuerySubscription` in
     Sentry. Updating in Snuba means deleting the existing subscription, then creating a
@@ -90,7 +90,7 @@ def update_subscription_in_snuba(query_subscription_id):
     default_retry_delay=5,
     max_retries=5,
 )
-def delete_subscription_from_snuba(query_subscription_id):
+def delete_subscription_from_snuba(query_subscription_id, **kwargs):
     """
     Task to delete a corresponding subscription in Snuba from a `QuerySubscription` in
     Sentry. Deletes the local subscription once we've successfully removed from Snuba.