codacy
This commit is contained in:
parent
1b07bf1020
commit
a6870d3775
|
@ -110,7 +110,7 @@ class ImgProxyCache(object):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
headers = pickle.loads(headers) # nosec
|
headers = pickle.loads(headers) # nosec
|
||||||
except Exception as e:
|
except Exception:
|
||||||
self.redis.delete(self.key('headers', url))
|
self.redis.delete(self.key('headers', url))
|
||||||
headers = None
|
headers = None
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
from json import dumps
|
from json import dumps
|
||||||
from flask import url_for
|
|
||||||
from app import imgproxy
|
|
||||||
|
|
||||||
|
|
||||||
def account(acc):
|
def account(acc):
|
||||||
|
|
2
tasks.py
2
tasks.py
|
@ -331,7 +331,7 @@ def update_mastodon_instances_popularity():
|
||||||
amount = 0.001
|
amount = 0.001
|
||||||
if acct.policy_enabled:
|
if acct.policy_enabled:
|
||||||
amount = 0.01
|
amount = 0.01
|
||||||
for session in acct.sessions:
|
for _ in acct.sessions:
|
||||||
amount += 0.01
|
amount += 0.01
|
||||||
instance.bump(amount / instance.popularity)
|
instance.bump(amount / instance.popularity)
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ def app(redisdb):
|
||||||
app_.debug = True
|
app_.debug = True
|
||||||
|
|
||||||
@app_.route('/')
|
@app_.route('/')
|
||||||
def hello():
|
def hello(): # pylint: disable=W0612
|
||||||
return 'Hello, world!'
|
return 'Hello, world!'
|
||||||
with app_.app_context():
|
with app_.app_context():
|
||||||
yield app_
|
yield app_
|
||||||
|
@ -95,7 +95,7 @@ def test_brotli_dynamic_timeout(app):
|
||||||
libforget.brotli.brotli(app, timeout=0.001)
|
libforget.brotli.brotli(app, timeout=0.001)
|
||||||
|
|
||||||
@app.route('/hard_to_compress')
|
@app.route('/hard_to_compress')
|
||||||
def hard_to_compress():
|
def hard_to_compress(): # pylint: disable=W0612
|
||||||
return token_urlsafe(2**16)
|
return token_urlsafe(2**16)
|
||||||
|
|
||||||
client = app.test_client()
|
client = app.test_client()
|
||||||
|
|
Loading…
Reference in New Issue