Compare commits
No commits in common. "main" and "v0.8.0" have entirely different histories.
@ -194,15 +194,3 @@ func (c *Client) addToCache(longURL, shortID string) {
|
|||||||
})
|
})
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) remFromCache(longURL string) {
|
|
||||||
c.cacheMap.Remove(longURL)
|
|
||||||
|
|
||||||
// Async write to BoltDB
|
|
||||||
go func() {
|
|
||||||
_ = c.db.Update(func(tx *bolt.Tx) error {
|
|
||||||
b := tx.Bucket([]byte("url_cache"))
|
|
||||||
return b.Delete([]byte(longURL))
|
|
||||||
})
|
|
||||||
}()
|
|
||||||
}
|
|
||||||
|
@ -96,8 +96,7 @@ func (c *Client) enqueueJob(job shortenJob) {
|
|||||||
select {
|
select {
|
||||||
case c.retryQueue <- job:
|
case c.retryQueue <- job:
|
||||||
default:
|
default:
|
||||||
log.Println("Retry queue full, dropping job and removing from caches:", job.ID, job.URL)
|
log.Println("Retry queue full, dropping job:", job.ID)
|
||||||
go c.remFromCache(job.URL)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user