Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Main
Synchronet
Commits
81a0af31
Commit
81a0af31
authored
1 month ago
by
Rob Swindell
Browse files
Options
Downloads
Patches
Plain Diff
Ajust the log levels and details of log messages
make the output less 'chatty'
parent
44ad0d3d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#7903
passed
1 month ago
Stage: build
Stage: test
Stage: cleanup
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
exec/delfiles.js
+15
-11
15 additions, 11 deletions
exec/delfiles.js
with
15 additions
and
11 deletions
exec/delfiles.js
+
15
−
11
View file @
81a0af31
...
...
@@ -52,12 +52,12 @@ var now = time();
for
(
var
i
in
dir_list
)
{
var
dir_code
=
dir_list
[
i
];
var
dir
=
file_area
.
dir
[
dir_code
];
log
(
dir_code
);
log
(
LOG_DEBUG
,
dir_code
);
var
base
=
new
FileBase
(
dir_code
);
if
(
!
base
.
open
())
throw
new
Error
(
base
.
last_error
);
if
(
options
.
offline
)
{
log
(
"
Purging offline files
"
);
log
(
dir_code
+
"
:
Purging offline files
"
);
var
list
=
base
.
get_names
(
/* sort: */
false
);
var
removed
=
0
;
for
(
var
j
=
0
;
j
<
list
.
length
;
j
++
)
{
...
...
@@ -65,7 +65,7 @@ for(var i in dir_list) {
if
(
exclude
.
indexOf
(
file
.
toUpperCase
())
>=
0
)
continue
;
if
(
base
.
get_size
(
file
)
<
0
)
{
log
(
"
Removing offline file:
"
+
base
.
get_path
(
file
));
log
(
LOG_INFO
,
dir_code
+
"
:
Removing offline file:
"
+
base
.
get_path
(
file
));
if
(
options
.
test
)
removed
++
;
else
{
...
...
@@ -76,11 +76,12 @@ for(var i in dir_list) {
}
}
}
log
(
"
Removed
"
+
removed
+
"
offline files
"
);
if
(
removed
)
log
(
LOG_NOTICE
,
dir_code
+
"
: Removed
"
+
removed
+
"
offline files
"
);
}
var
max_age
=
base
.
max_age
||
dir
.
max_age
;
if
(
max_age
)
{
log
(
"
Purging old files, imposing max age of
"
+
max_age
+
"
days
"
);
log
(
dir_code
+
"
:
Purging old files, imposing max age of
"
+
max_age
+
"
days
"
);
var
list
=
base
.
get_list
(
FileBase
.
DETAIL
.
NORM
,
/* sort: */
false
);
var
removed
=
0
;
for
(
var
j
=
0
;
j
<
list
.
length
;
j
++
)
{
...
...
@@ -96,7 +97,7 @@ for(var i in dir_list) {
}
var
file_age
=
Math
.
floor
((
now
-
t
)
/
(
24
*
60
*
60
));
if
(
file_age
>
max_age
)
{
log
(
"
Removing
"
+
base
.
get_path
(
file
.
name
)
+
"
"
+
age_desc
+
"
"
+
file_age
+
"
days ago
"
);
log
(
LOG_INFO
,
dir_code
+
"
:
Removing
"
+
base
.
get_path
(
file
.
name
)
+
"
"
+
age_desc
+
"
"
+
file_age
+
"
days ago
"
);
if
(
options
.
test
)
removed
++
;
else
{
...
...
@@ -107,11 +108,13 @@ for(var i in dir_list) {
}
}
}
log
(
"
Removed
"
+
removed
+
"
of
"
+
list
.
length
+
"
files due to age of
"
+
max_age
+
"
days
"
);
if
(
removed
)
log
(
LOG_NOTICE
,
"
: Removed
"
+
removed
+
"
of
"
+
list
.
length
+
"
files due to age of
"
+
max_age
+
"
days
"
);
}
var
max_files
=
base
.
max_files
||
dir
.
max_files
;
if
(
max_files
)
{
log
(
"
Purging excess files, imposing max files limit of
"
+
max_files
);
var
tfiles
=
file_area
.
dir
[
dir_code
].
files
;
if
(
max_files
&&
tfiles
>
max_files
)
{
log
(
dir_code
+
"
: Purging excess files, imposing max files limit of
"
+
max_files
+
"
in area with
"
+
tfiles
+
"
files
"
);
var
list
=
base
.
get_list
(
FileBase
.
DETAIL
.
MIN
,
/* sort: */
false
);
var
removed
=
0
;
var
excess
=
list
.
length
-
max_files
;
...
...
@@ -119,7 +122,7 @@ for(var i in dir_list) {
var
file
=
list
[
j
];
if
(
exclude
.
indexOf
(
file
.
name
.
toUpperCase
())
>=
0
)
continue
;
log
(
"
Removing
"
+
file
.
name
);
log
(
LOG_INFO
,
dir_code
+
"
:
Removing
"
+
file
.
name
);
if
(
options
.
test
)
removed
++
;
else
{
...
...
@@ -129,7 +132,8 @@ for(var i in dir_list) {
removed
++
;
}
}
log
(
"
Removed
"
+
removed
+
"
of
"
+
list
.
length
+
"
files due to max file limit of
"
+
max_files
);
if
(
removed
)
log
(
LOG_NOTICE
,
"
: Removed
"
+
removed
+
"
of
"
+
list
.
length
+
"
files due to max file limit of
"
+
max_files
);
}
base
.
close
();
...
...
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