Merge pull request #210 from mistercrunch/conns

Fixing os file timestamp read race condition
This commit is contained in:
Maxime Beauchemin 2015-05-11 08:16:14 -07:00
Родитель 854e9142a5 cb9b1b9696
Коммит 6500af8f1b
1 изменённых файлов: 6 добавлений и 1 удалений

Просмотреть файл

@ -131,7 +131,12 @@ class DagBag(object):
Given a path to a python module, this method imports the module and
look for dag objects whithin it.
"""
try:
# This failed before in what may have been a git sync
# race condition
dttm = datetime.fromtimestamp(os.path.getmtime(filepath))
except:
dttm = datetime(2001, 1, 1)
mod_name, file_ext = os.path.splitext(os.path.split(filepath)[-1])
mod_name = 'unusual_prefix_' + mod_name