Quellcode durchsuchen

Merge branch 'master' into develop

version-14
Anand Doshi vor 9 Jahren
Ursprung
Commit
3acd8b462e
2 geänderte Dateien mit 4 neuen und 4 gelöschten Zeilen
  1. +1
    -1
      frappe/__init__.py
  2. +3
    -3
      frappe/utils/file_lock.py

+ 1
- 1
frappe/__init__.py Datei anzeigen

@@ -1233,4 +1233,4 @@ def get_desk_link(doctype, name):
return '<a href="#Form/{0}/{1}" style="font-weight: bold;">{2} {1}</a>'.format(doctype, name, _(doctype)) return '<a href="#Form/{0}/{1}" style="font-weight: bold;">{2} {1}</a>'.format(doctype, name, _(doctype))


def bold(text): def bold(text):
return '<b>{0}</b>'.format(text)
return '<b>{0}</b>'.format(text)

+ 3
- 3
frappe/utils/file_lock.py Datei anzeigen

@@ -1,5 +1,5 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
# MIT License. See license.txt


from __future__ import unicode_literals from __future__ import unicode_literals


@@ -18,10 +18,10 @@ def create_lock(name):
else: else:
return False return False


def check_lock(path):
def check_lock(path, timeout=600):
if not os.path.exists(path): if not os.path.exists(path):
return False return False
if time() - os.path.getmtime(path) > 600:
if time() - os.path.getmtime(path) > timeout:
raise LockTimeoutError(path) raise LockTimeoutError(path)
return True return True




Laden…
Abbrechen
Speichern