Last active
April 18, 2022 11:28
-
-
Save agammahajan1/4104b20d062472f8ea8a153355a56e2a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func cleanExpiredVideos() { | |
let currentTimeStamp = Date().timeIntervalSince1970 | |
var expiredKeys: [String] = [] | |
for videoData in videosDict where currentTimeStamp - videoData.value.timeStamp >= expiryTime { | |
// video is expired. delete | |
if let _ = popupVideosDict[videoData.key] { | |
expiredKeys.append(videoData.key) | |
} | |
} | |
for key in expiredKeys { | |
if let _ = popupVideosDict[key] { | |
popupVideosDict.removeValue(forKey: key) | |
deleteVideo(ForVideoId: key) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What is
videosDict
here?