1
0
mirror of https://git.sr.ht/~cadence/bibliogram synced 2026-01-04 21:11:31 +00:00

Tor check bug fixes; recognise december blocking

This commit is contained in:
Cadence Ember
2021-01-19 01:45:22 +13:00
parent df61faeb3b
commit 934e6baf06
6 changed files with 41 additions and 9 deletions

View File

@@ -17,18 +17,18 @@ class TorManager {
}
async request(url, test) {
let result = null
let done = false
let g
while (!done) {
const req = await request(url, {agent: this.agent}, {log: true, statusLine: "TOR"})
g = await request(url, {agent: this.agent}, {log: true, statusLine: "TOR"})
try {
result = await test(req)
done = true
await g.check(test)
break
} catch (e) {
await this.newCircuit()
}
}
return result
return g
}
newCircuit() {