Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@agammahajan1
Last active April 18, 2022 11:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save agammahajan1/4104b20d062472f8ea8a153355a56e2a to your computer and use it in GitHub Desktop.
Save agammahajan1/4104b20d062472f8ea8a153355a56e2a to your computer and use it in GitHub Desktop.
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)
}
}
}
@trantorGurjitSingh
Copy link

What is videosDict here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment