Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
60445cf3
提交
60445cf3
authored
5月 28, 2010
作者:
Frederic Bastien
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
wait 1 week before we remove the unversionned directory of old compilation.
This will remove most of the error message that was changed today for a warning.
上级
9394b5e2
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
14 行增加
和
9 行删除
+14
-9
cmodule.py
theano/gof/cmodule.py
+14
-9
没有找到文件。
theano/gof/cmodule.py
浏览文件 @
60445cf3
...
@@ -455,7 +455,9 @@ class ModuleCache(object):
...
@@ -455,7 +455,9 @@ class ModuleCache(object):
#debug('stats', self.stats, sum(self.stats))
#debug('stats', self.stats, sum(self.stats))
return
rval
return
rval
age_thresh_del
=
60
*
60
*
24
*
31
age_thresh_del
=
60
*
60
*
24
*
31
#31 days
age_thresh_del_unversionned
=
60
*
60
*
24
*
7
#7 days
"""The default age threshold for `clear_old` (in seconds)
"""The default age threshold for `clear_old` (in seconds)
"""
"""
def
clear_old
(
self
,
age_thresh_del
=
None
):
#default to a 31-day age_thresh_delold
def
clear_old
(
self
,
age_thresh_del
=
None
):
#default to a 31-day age_thresh_delold
...
@@ -519,7 +521,8 @@ class ModuleCache(object):
...
@@ -519,7 +521,8 @@ class ModuleCache(object):
assert
parent
.
startswith
(
os
.
path
.
join
(
self
.
dirname
,
'tmp'
))
assert
parent
.
startswith
(
os
.
path
.
join
(
self
.
dirname
,
'tmp'
))
info
(
"clear_unversioned removing cache dir"
,
parent
)
info
(
"clear_unversioned removing cache dir"
,
parent
)
_rmtree
(
parent
)
_rmtree
(
parent
)
time_now
=
time
.
time
()
for
filename
in
os
.
listdir
(
self
.
dirname
):
for
filename
in
os
.
listdir
(
self
.
dirname
):
if
filename
.
startswith
(
'tmp'
):
if
filename
.
startswith
(
'tmp'
):
try
:
try
:
...
@@ -528,13 +531,15 @@ class ModuleCache(object):
...
@@ -528,13 +531,15 @@ class ModuleCache(object):
except
IOError
:
except
IOError
:
has_key
=
False
has_key
=
False
if
not
has_key
:
if
not
has_key
:
#TODO: Remove this, or at least wait one week
age
=
time_now
-
last_access_time
(
os
.
path
.
join
(
self
.
dirname
,
filename
))
# This cache dir is either in use by another process
#In normal case, the processus that created this directory will delete it
# (in that case, it will be removed by the code above),
#In case this processus crash, it won't be cleaned up.
# or a remnant of a crashed process, in that case, it will
#As we don't know how to know if this directory is still used
# be removed by clear_old at some point.
#we wait 1 weak and suppose that the processus crashed
info
(
"clear_unversioned removing cache dir"
,
filename
)
#and we do the clean up for it.
_rmtree
(
os
.
path
.
join
(
self
.
dirname
,
filename
))
if
age
>
self
.
age_thresh_del_unversionned
:
info
(
"clear_unversioned removing cache dir"
,
filename
)
_rmtree
(
os
.
path
.
join
(
self
.
dirname
,
filename
))
def
_on_atexit
(
self
):
def
_on_atexit
(
self
):
self
.
refresh
()
self
.
refresh
()
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论