gabotorresruiz commented on code in PR #35832:
URL: https://github.com/apache/superset/pull/35832#discussion_r2543883661


##########
superset/tasks/slack.py:
##########
@@ -15,29 +15,128 @@
 # specific language governing permissions and limitations
 # under the License.
 import logging
+from typing import Optional
 
 from flask import current_app
 
-from superset.extensions import celery_app
-from superset.utils.slack import get_channels
+from superset.extensions import cache_manager, celery_app
+from superset.utils.slack import (
+    get_channels_with_search,
+    SLACK_CHANNELS_CACHE_KEY,
+    SLACK_CHANNELS_CONTINUATION_CURSOR_KEY,
+    SlackChannelTypes,
+)
 
 logger = logging.getLogger(__name__)
 
 
-@celery_app.task(name="slack.cache_channels")
+@celery_app.task(
+    name="slack.cache_channels",
+    time_limit=300,  # 5 minute hard timeout (via SLACK_CACHE_WARMUP_TIMEOUT)
+    soft_time_limit=240,  # 4 minute warning

Review Comment:
   Ok this is a nice idea, now I'm using constants, and if someone needs to 
change the timeout, they only update `CACHE_WARMUP_TIME_LIMIT` and the soft 
timeout automatically adjusts to 80%



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to