mirror of
https://github.com/aljazceru/njump.git
synced 2025-12-17 14:24:27 +01:00
stop overwriting expiration times so eventually everything will be deleted.
This commit is contained in:
9
utils.go
9
utils.go
@@ -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, ¤tExpiration); exists {
|
||||
if nextExpiration < currentExpiration {
|
||||
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 {
|
||||
|
||||
Reference in New Issue
Block a user