- Optimize JPEGs and increase quality from 75 to 95
- Don't always convert to RGB, first check if RGBA and save as PNG optimized
Thanks to Dr. Sybren and Francesco for review and feedback
There can be a KeyError accessing permission['methods'], but our current
logging doesn't provide enough information as to determine when this
happens. Rather than bluntly fixing the issue, I added logging to try and
find out how we get a 'methods'-less permission dict in the first place.
The response object *should* be a requests.Response object, which *should*
have a .text property. However, there are situations where this is not the
case, and in those cases we now won't produce an AttributeError.
This makes it easier to see what the Celery worker is actually working on
when refreshing a large number of links.
It'll report on every N refreshed links, where N = link_count/25 but
clamped to N ∈ [5, 100]
I hope this fixes this error; I no longer see it locally:
Traceback (most recent call last):
File "/data/git/blender-cloud/runserver.wsgi", line 16, in <module>
application = PillarServer(my_path)
File "/data/git/pillar/pillar/__init__.py", line 96, in __init__
self._config_bugsnag()
File "/data/git/pillar/pillar/__init__.py", line 191, in _config_bugsnag
handle_exceptions(self)
File "/opt/python/lib/python3.6/site-packages/bugsnag/flask/__init__.py", line 27, in handle_exceptions
got_request_exception.connect(__log_exception, app)
File "/opt/python/lib/python3.6/site-packages/blinker/base.py", line 130, in connect
sender_ref = reference(sender, self._cleanup_sender)
File "/opt/python/lib/python3.6/site-packages/blinker/_utilities.py", line 134, in reference
weak = callable_reference(object, callback)
File "/opt/python/lib/python3.6/site-packages/blinker/_utilities.py", line 145, in callable_reference
return BoundMethodWeakref(target=object, on_delete=callback)
File "/opt/python/lib/python3.6/site-packages/blinker/_saferef.py", line 135, in __new__
key = cls.calculate_key(target)
File "/opt/python/lib/python3.6/site-packages/blinker/_saferef.py", line 196, in calculate_key
return (id(get_self(target)), id(get_func(target)))
File "/opt/python/lib/python3.6/site-packages/events/events.py", line 41, in __getattr__
(self.__class__.__name__, name))
AttributeError: type object 'PillarServer' has no attribute '__self__'
Before this, the user's authentication token would still be stored in
the session even when it's found to be invalid. This caused a login
action to fail, but not in such a way that we would redirect to the login
page of Blender ID. Rather, it would keep you not logged in. By clearing
the session we're sure that the invalid token is forgotten, and the next
request will handle the login properly.
This uses the orphan-files.txt file output by find_orphan_files() to
mark those files as deleted. This allows for a two-stage approach, where
file IDs are found on one machine (against a read-only MongoDB slave, for
example) and soft-deleted on another machine (against a writable master).