-
Notifications
You must be signed in to change notification settings - Fork 196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Save redirect not working and occasionally failing to save #59
Comments
I see, this is most probably the same issue as #51, i.e. using the CacheRosettaStorage with a multi-process wsgi server and the LocMemCache backend, each server process having a distinct cache instance. Could you please try to either use a shared cache backend (such as the Memcache) or switching to the SessionRosettaStorage and see if the problem goes away? |
I've quickly installed django-redis-cache (as I already run Redis as part of this application) but still the Save button is not moving the page forward and I still have the problem with 'runserver'. Seems potentially time bound. Now that I test it a different way... by repeatedly using the Save button on page 1, which as I explained continuously reloads page 1.
|
Have you specified a TIMEOUT [1] value when setting up your Redis backend? Could I ask you to try to specify a large TIMEOUT value (e.g. 86400) and see if the problem persists after waiting a couple minutes? 1: https://docs.djangoproject.com/en/dev/topics/cache/?from=olddocs#cache-arguments |
Some progress. By keeping an eye on cache keys in Redis, I can confirm the error appears right after the cache expires. Somewhat frustrating is that I can't seem to get the TIMEOUT parameter on the redis cache configuration to work. I tried setting it to 24hrs (86400) as suggested, and also to -1 which the django-redis-cache docs indicate should mean the keys never expire. Despite this I can see that a TTL is still applied to the cache keys on creation. Also interesting/frustrating is that the TTL isn't restarted when saving or refreshing the page. So the session time is fixed from the very first time the session cache is established, not the most recent request. Seems like it could be the way Rosetta interacts with the cache? |
Well, Rosetta uses the "official" Django cache API, i.e. cache.set() and cache.get()
|
That looks a helluva lot more like it....
From what I see in the django docs, it should default to the cache TIMEOUT configuration as you originally suggested. So I think the usage in rosetta's CacheRosettaStorage looks correct. So I'll probably take this one to the django-redis-cache project. Right? On the other hand, I don't have a save button that navigates fwd. Shall I raise a separate issue for this? Thanks much for your help with this - I sure learnt a thing or two :-) |
Thanks for the feedback, I'm going to add an explicit cache timeout on that cache.set(). I'm going to look into that save button thing… |
Thanks for this, experienced the same thing myself. |
Hi all, As Readme.rst says: The problem was solved, for me, installing memcached on server/s and adding the proper config in settings: Good luck! |
Thank you @aasensiog a lot. |
Housekeeping close. |
The initial problem I have is that the "save and translate next block" doesn't navigate forward to the next block, it simply saves the translations on the current page and redisplays it.
After hitting save, it is possible to move forward manually using the numbered page links which is what I've asked my translator to do.
However the bigger problem is that after repeating the above for several pages, on the ~6th page of translations the save button redirects back to the Language selection page and the most recent set of translations are lost. Previously saved pages are retained.
Seems likely to be an issue with session/caching but I have no idea where to start....
Django 1.4 and Rosetta 0.6.8.
I experience the issue under two server configurations:
Configuration:
ROSETTA_STORAGE_CLASS = 'rosetta.storage.CacheRosettaStorage'
SESSION_COOKIE_SECURE = False
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
'LOCATION': 'dwight-dev',
}
}
The text was updated successfully, but these errors were encountered: