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:
11
utils.go
11
utils.go
@@ -197,21 +197,16 @@ func getRelaysForEvent(eventId string) []string {
|
|||||||
return relays
|
return relays
|
||||||
}
|
}
|
||||||
|
|
||||||
func scheduleEventExpiration(eventId string, ts time.Duration) {
|
func scheduleEventExpiration(id string, ts time.Duration) {
|
||||||
key := "ttl:" + eventId
|
key := "ttl:" + id
|
||||||
nextExpiration := time.Now().Add(ts).Unix()
|
nextExpiration := time.Now().Add(ts).Unix()
|
||||||
var currentExpiration int64
|
var currentExpiration int64
|
||||||
if exists := cache.GetJSON(key, ¤tExpiration); exists {
|
if exists := cache.GetJSON(key, ¤tExpiration); exists {
|
||||||
if nextExpiration < currentExpiration {
|
return
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
cache.SetJSON(key, nextExpiration)
|
cache.SetJSON(key, nextExpiration)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Rendering functions
|
|
||||||
// ### ### ### ### ### ### ### ### ### ### ###
|
|
||||||
|
|
||||||
func replaceURLsWithTags(input string, imageReplacementTemplate, videoReplacementTemplate string, skipLinks bool) string {
|
func replaceURLsWithTags(input string, imageReplacementTemplate, videoReplacementTemplate string, skipLinks bool) string {
|
||||||
return urlMatcher.ReplaceAllStringFunc(input, func(match string) string {
|
return urlMatcher.ReplaceAllStringFunc(input, func(match string) string {
|
||||||
switch {
|
switch {
|
||||||
|
|||||||
Reference in New Issue
Block a user