Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CastorScript
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
atlas-tdaq-software
CastorScript
Commits
ddf872a5
Commit
ddf872a5
authored
6 years ago
by
Fabrice Le Goff
Browse files
Options
Downloads
Patches
Plain Diff
do not check file size if MinSizekB is not set
parent
95780cc8
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#487456
passed
6 years ago
Stage: test
Changes
1
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Script/ManagerThread.py
+21
-21
21 additions, 21 deletions
Script/ManagerThread.py
with
21 additions
and
21 deletions
Script/ManagerThread.py
+
21
−
21
View file @
ddf872a5
...
@@ -240,28 +240,28 @@ class ManagerThread(threading.Thread):
...
@@ -240,28 +240,28 @@ class ManagerThread(threading.Thread):
# end if
# end if
### Check for minimal file size, if needed
### Check for minimal file size, if needed
try
:
if
self
.
MinSizekB
:
filesize
=
os
.
path
.
getsize
(
filename
)
try
:
except
OSError
as
exc
:
filesize
=
os
.
path
.
getsize
(
filename
)
if
exc
.
errno
==
errno
.
ENOENT
:
except
OSError
as
exc
:
# The file has been removed by an external cause.
if
exc
.
errno
==
errno
.
ENOENT
:
# This is bad but this is not a reason to crash
.
# The file has been removed by an external cause
.
self
.
logger
.
critical
(
'
error getting file size for %s: not present (deleted by external cause)
'
,
filename
)
# This is bad but this is not a reason to crash.
continue
self
.
logger
.
critical
(
'
error getting file size for %s: no such file
'
,
filename
)
else
:
continue
raise
exc
else
:
raise
exc
if
self
.
MinSizekB
and
\
filesize
/
1024.
<
self
.
MinSizekB
:
if
filesize
/
1024.
<
self
.
MinSizekB
:
self
.
logger
.
debug
(
'
File %s is too small. Skipping.
'
,
filename
)
self
.
logger
.
debug
(
'
File %s is too small. Skipping.
'
,
filename
)
if
self
.
RemoveSmallFiles
:
if
self
.
RemoveSmallFiles
:
self
.
logger
.
debug
(
'
File %s is too small. Deleting.
'
,
filename
)
self
.
logger
.
debug
(
'
File %s is too small. Deleting.
'
,
filename
)
try
:
try
:
os
.
remove
(
filename
)
os
.
remove
(
filename
)
except
OSError
,
ex
:
except
OSError
,
ex
:
self
.
logger
.
warning
(
'
Cannot delete %s. ERROR: %s
'
,
filename
,
ex
.
__repr__
())
self
.
logger
.
warning
(
'
Cannot delete %s. ERROR: %s
'
,
filename
,
ex
.
__repr__
())
continue
continue
##### Do not take already listed files #####
##### Do not take already listed files #####
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment