Zed пре 3 година
родитељ
комит
282ce8b0e9
3 измењених фајлова са 2 додато и 3 уклоњено
  1. 1 0
      src/apiutils.nim
  2. 1 1
      src/tokens.nim
  3. 0 2
      src/types.nim

+ 1 - 0
src/apiutils.nim

@@ -103,6 +103,7 @@ template fetchImpl(result, fetchBody) {.dirty.} =
           setLimited(account, api)
           raise rateLimitError()
       elif result.startsWith("429 Too Many Requests"):
+        echo "[accounts] 429 error, API: ", api, ", account: ", account.id
         account.apis[api].remaining = 0
         # rate limit hit, resets after the 15 minute window
         raise rateLimitError()

+ 1 - 1
src/tokens.nim

@@ -109,7 +109,7 @@ proc invalidate*(account: var GuestAccount) =
   if idx > -1: accountPool.delete(idx)
   account = nil
 
-proc release*(account: GuestAccount; invalid=false) =
+proc release*(account: GuestAccount) =
   if account.isNil: return
   dec account.pending
 

+ 0 - 2
src/types.nim

@@ -40,8 +40,6 @@ type
     id*: string
     oauthToken*: string
     oauthSecret*: string
-    # init*: Time
-    lastUse*: Time
     pending*: int
     apis*: Table[Api, RateLimit]