Allow spotting upstream to cluster. #39

This commit is contained in:
Ian Renton
2026-09-27 11:09:20 +01:00
parent 1a48d178ca
commit 27bd8a6b44
28 changed files with 192 additions and 81 deletions
+8 -1
View File
@@ -5,6 +5,12 @@ import pytz
from core.data_store import DATA_STORE
class SpotSubmissionError(Exception):
"""Raised by a provider's submit_spot() when the upstream service refused or didn't accept the spot. The message
is returned in the API / showed on the web UI. This is probably a user error, so we log a warning rather than a big
stack trace like we would if we got some unexpected exception."""
class SpotProvider:
"""Generic spot provider class. Subclasses of this query the individual APIs for data."""
@@ -61,7 +67,8 @@ class SpotProvider:
raise NotImplementedError("Subclasses must implement this method")
def can_submit_spot(self, activity):
"""Return True if this provider supports submitting spots upstream for the given activity."""
"""Return True if this provider supports submitting spots upstream for the given activity. Activity can be None,
to check whether this provider supports submitting spots that have no activity."""
return False