stop overwriting expiration times so eventually everything will be deleted.

This commit is contained in:
fiatjaf
2024-01-28 07:23:25 -03:00
parent f8cc08dc40
commit b551f30efb

View File

@@ -197,21 +197,16 @@ func getRelaysForEvent(eventId string) []string {
return relays
}
func scheduleEventExpiration(eventId string, ts time.Duration) {
key := "ttl:" + eventId
func scheduleEventExpiration(id string, ts time.Duration) {
key := "ttl:" + id
nextExpiration := time.Now().Add(ts).Unix()
var currentExpiration int64
if exists := cache.GetJSON(key, &currentExpiration); exists {
if nextExpiration < currentExpiration {
return
}
return
}
cache.SetJSON(key, nextExpiration)
}
// Rendering functions
// ### ### ### ### ### ### ### ### ### ### ###
func replaceURLsWithTags(input string, imageReplacementTemplate, videoReplacementTemplate string, skipLinks bool) string {
return urlMatcher.ReplaceAllStringFunc(input, func(match string) string {
switch {