1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-05-11 09:24:38 +00:00

cache set repo_id_file_path and doc_key when get onlyoffice dict

This commit is contained in:
lian 2021-07-08 09:59:32 +08:00
parent cbc99a161d
commit 9316eecdc9
2 changed files with 2 additions and 6 deletions
seahub/onlyoffice

View File

@ -84,6 +84,8 @@ def get_onlyoffice_dict(request, username, repo_id, file_path, file_id='',
info_bytes = force_bytes(origin_repo_id + origin_file_path + file_id)
doc_key = hashlib.md5(info_bytes).hexdigest()[:20]
logger.info('generate new doc_key {} by info {}'.format(doc_key, info_bytes))
logger.info('set cache_key {} and doc_key {} to cache'.format(cache_key, doc_key))
cache.set(cache_key, doc_key, None)
doc_info = json.dumps({'repo_id': origin_repo_id,
'file_path': origin_file_path,

View File

@ -139,12 +139,6 @@ def onlyoffice_editor_callback(request):
if is_pro_version() and if_locked_by_online_office(repo_id, file_path):
seafile_api.unlock_file(repo_id, file_path)
# 6 - document is being edited, but the current document state is saved,
if status == 6:
# cache document key when forcesave
logger.info('status {}: set cache_key {} and doc_key {} to cache'.format(status, cache_key, doc_key))
cache.set(cache_key, doc_key, None)
# 4 - document is closed with no changes,
if status == 4: