mirror of
https://github.com/microsoft/onefuzz.git
synced 2025-06-16 03:48:09 +00:00
add Timestamp to multiple models (#796)
Expose the Azure storage table's "Timestamp" for the models where Timestamp should be user-accessible and remove the Timestamp field from models that did not sign up for it. The behavior where Timestamp is only set by Azure Storage is kept.
This commit is contained in:
@ -42,6 +42,7 @@ PROXY_LOG_PREFIX = "scaleset-proxy: "
|
||||
# This isn't intended to ever be shared to the client, hence not being in
|
||||
# onefuzztypes
|
||||
class Proxy(ORMMixin):
|
||||
timestamp: Optional[datetime.datetime] = Field(alias="Timestamp")
|
||||
region: Region
|
||||
state: VmState = Field(default=VmState.init)
|
||||
auth: Authentication = Field(default_factory=build_auth)
|
||||
@ -179,12 +180,12 @@ class Proxy(ORMMixin):
|
||||
)
|
||||
return False
|
||||
|
||||
elif not self.heartbeat and self.Timestamp and self.Timestamp < ten_minutes_ago:
|
||||
elif not self.heartbeat and self.timestamp and self.timestamp < ten_minutes_ago:
|
||||
logging.error(
|
||||
PROXY_LOG_PREFIX + "no heartbeat in the last 10 minutes: "
|
||||
"%s timestamp: %s compared_to:%s",
|
||||
self.region,
|
||||
self.Timestamp,
|
||||
self.timestamp,
|
||||
ten_minutes_ago,
|
||||
)
|
||||
return False
|
||||
|
Reference in New Issue
Block a user