You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
filter_by_var_named (str or None): If you only want to get data for one cloud variable, set this argument to its name.
51
52
limit (int): Max. amount of returned activity.
52
53
offset (int): Offset of the first activity in the returned list.
53
54
log_url (str): If you want to get the clouddata from a cloud log API different to Scratch's normal cloud log API, set this argument to the URL of the API. Only set this argument if you know what you are doing. If you want to get the clouddata from the normal API, don't put this argument.
Sends back the request response to the Scratch project
276
277
"""
277
-
if (self.cloud.last_var_set+8<time.time() # if the cloud connection has been idle for too long, a reconnect is necessary to make sure the first package will not be lost
278
+
if (getattr(self.cloud, "last_var_set", time.time())+8<time.time() # if the cloud connection has been idle for too long, a reconnect is necessary to make sure the first package will not be lost
length_limit=self.cloud.length_limit- (len(str(request_id))+6) # the subtrahend is the worst-case length of the "."+numbers after the "."
284
+
length_limit=getattr(self.cloud, "length_limit", 256)- (len(str(request_id))+6) # the subtrahend is the worst-case length of the "."+numbers after the "."
284
285
285
286
i=0
286
287
whilenotremaining_response=="":
@@ -457,11 +458,12 @@ def on_reconnect(self):
457
458
Called when the underlying cloud events reconnect. Makes sure that no requests are missed in this case.
458
459
"""
459
460
try:
460
-
extradata=self.cloud.logs(limit=35)[::-1] # Reverse result so oldest activity is first
461
-
foractivityinextradata:
462
-
ifactivity.timestamp<self.startup_time:
463
-
continue
464
-
self.on_set(activity) # Read in the fetched activity
461
+
ifisinstance(self.cloud, _base.LogCloud):
462
+
extradata=self.cloud.logs(limit=35)[::-1] # Reverse result so oldest activity is first
463
+
foractivityinextradata:
464
+
ifactivity.timestamp<self.startup_time:
465
+
continue
466
+
self.on_set(activity) # Read in the fetched activity
0 commit comments