Django warning: RemovedInDjango19Warning: `MemcachedCache._get_memcache_timeout` method should be renamed `get_backend_timeout`.

RESOLVED FIXED

Status

Tree Management
Treeherder
P3
normal
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: emorley, Assigned: emorley)

Tracking

Details

Attachments

(1 attachment)

(Assignee)

Description

2 years ago
eg:
/home/vagrant/treeherder/treeherder/cache.py:8: RemovedInDjango19Warning: `MemcachedCache._get_memcache_timeout` method should be renamed `get_backend_timeout`.

We can probably just remove our custom wrapper entirely.

Django 1.7 added a new timeout pref, which might replace the custom _get_memcache_timeout()

And the custom set() that gives a return value isn't actually being used, since we never look at the return value.
(Assignee)

Comment 2

2 years ago
Created attachment 8691524 [details] [review]
Remove the custom wrapper around Django's MemcachedCache
Attachment #8691524 - Flags: review?(mdoglio)
Attachment #8691524 - Flags: review?(mdoglio) → review+

Comment 3

2 years ago
Commit pushed to master at https://github.com/mozilla/treeherder

https://github.com/mozilla/treeherder/commit/014bcd7c5a08234d4ffc09cbb15412cfaf47ae51
Bug 1227653 - Remove the custom wrapper around Django's MemcachedCache

It purports to add two features:
(a) the ability to set a "never expire"
(b) the ability to check the result of a set()

However (a) isn't needed any more, since Django supports this natively
(albeit "never expire" is set with a `TIMEOUT` of `None` rather than 0),
and (b) isn't used, since Treeherder never checks the return value from
cache.set():
https://github.com/mozilla/treeherder/search?q=%22cache.set%22

The custom wrapper is also the cause of deprecation warnings, eg:
RemovedInDjango19Warning: `MemcachedCache._get_memcache_timeout` method
should be renamed `get_backend_timeout`.

It was copied from Datazilla:
https://github.com/mozilla/datazilla/pull/37

...which at the time was using Django 1.3.1, which didn't support never
expiring:
https://github.com/django/django/blob/1.3.1/django/core/cache/backends/memcached.py#L41

Whereas 1.7+ does:
https://github.com/django/django/blob/1.8.5/django/core/cache/backends/memcached.py#L56
https://docs.djangoproject.com/en/1.8/ref/settings/#std:setting-CACHES-TIMEOUT
(Assignee)

Updated

2 years ago
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.