// Get internal time
sip = self.r.get("slips_internal_time")
// for each profile
profiles = self.getProfiles()
for profileid in profiles:
// Get the last TW on in profile
lastTWid = self.r.zrange("tws" + profileid, -1, -1, withscores=True)
After Change
modification_time = float(sit) - 20
profiles_to_close = self.r.zrangebyscore("ModifiedTW", 0, modification_time, withscores=True)
for profile_to_close in profiles_to_close:
profile_to_close_id = profile_to_close[0]
profile_to_close_time = profile_to_close[1]
self.print(f"The profile id {profile_to_close_id} has to be closed because it was last modifed on {profile_to_close_time} and we are closing everything older than {modification_time}. Current time {sit}. Difference: {modification_time - profile_to_close_time}")
def add_ips(self, profileid, twid, ip_as_obj, columns, role: str):