Skip to content

Commit

Permalink
fix: requested change #2
Browse files Browse the repository at this point in the history
  • Loading branch information
resslr committed Jan 9, 2025
1 parent d026c8d commit 3e610d1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions handlers/redirect.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func Redirect(w http.ResponseWriter, r *http.Request) {
Logger.Info("Cache Miss, redirect code not found", "code", code, "user-agent", r.UserAgent())
http.Redirect(w, r, originalUrl, http.StatusSeeOther)

// Update the accessed_count and last_accessed in one query
// Todo: update last-time/access count in cache
err = queries.UpdateAccessedAndLastCount(r.Context(), database.UpdateAccessedAndLastCountParams{
Code: code,
LastAccessed: time.Now().UTC(),
Expand All @@ -71,7 +71,7 @@ func Redirect(w http.ResponseWriter, r *http.Request) {
Logger.Info("Cache hit, redirect code found", "code", code, "user-agent", r.UserAgent())
http.Redirect(w, r, originalUrl.(string), http.StatusSeeOther)

// Update the accessed_count and last_accessed in one query
// Todo: update last-time/access count in cache
err = queries.UpdateAccessedAndLastCount(r.Context(), database.UpdateAccessedAndLastCountParams{
Code: code,
LastAccessed: time.Now().UTC(),
Expand Down

0 comments on commit 3e610d1

Please sign in to comment.