Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
auto-tx
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
vamp
auto-tx
Commits
2ecd8d01
Commit
2ecd8d01
authored
5 years ago
by
Niko Ehrenfeuchter
Browse files
Options
Downloads
Patches
Plain Diff
Some renamings to use less over-specific names
Refers to
#20
parent
171a0c1f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ATxCommon/StorageStatus.cs
+10
-10
10 additions, 10 deletions
ATxCommon/StorageStatus.cs
with
10 additions
and
10 deletions
ATxCommon/StorageStatus.cs
+
10
−
10
View file @
2ecd8d01
...
...
@@ -18,7 +18,7 @@ namespace ATxCommon
private
static
readonly
Logger
Log
=
LogManager
.
GetCurrentClassLogger
();
private
readonly
Dictionary
<
string
,
List
<
DirectoryDetails
>>
_expired
User
Dirs
;
private
readonly
Dictionary
<
string
,
List
<
DirectoryDetails
>>
_expiredDirs
;
private
readonly
List
<
DriveToCheck
>
_drives
;
private
readonly
int
_gracePeriod
;
...
...
@@ -34,17 +34,17 @@ namespace ATxCommon
_gracePeriod
=
config
.
GracePeriod
;
_gracePeriodHuman
=
config
.
HumanGracePeriod
;
_graceLocation
=
new
DirectoryInfo
(
config
.
DonePath
);
_expired
User
Dirs
=
new
Dictionary
<
string
,
List
<
DirectoryDetails
>>();
_expiredDirs
=
new
Dictionary
<
string
,
List
<
DirectoryDetails
>>();
Update
();
}
/// <summary>
/// Number of expired directories in the grace location.
/// </summary>
public
int
Expired
User
DirsCount
{
public
int
ExpiredDirsCount
{
get
{
Update
();
return
_expired
User
Dirs
.
Count
;
return
_expiredDirs
.
Count
;
}
}
...
...
@@ -66,10 +66,10 @@ namespace ATxCommon
/// <summary>
/// Get a dictionary of expired directories from the grace location.
/// </summary>
public
Dictionary
<
string
,
List
<
DirectoryDetails
>>
Expired
User
Dirs
{
public
Dictionary
<
string
,
List
<
DirectoryDetails
>>
ExpiredDirs
{
get
{
Update
();
return
_expired
User
Dirs
;
return
_expiredDirs
;
}
}
...
...
@@ -84,12 +84,12 @@ namespace ATxCommon
$"threshold:
{
_gracePeriod
}
days (
{
_gracePeriodHuman
}
) ------\n\n"
+
$" - location: [
{
_graceLocation
}
]\n"
;
if
(
_expired
User
Dirs
.
Count
==
0
)
if
(
_expiredDirs
.
Count
==
0
)
return
summary
+
" -- NO EXPIRED folders in grace location! --"
;
foreach
(
var
dir
in
_expired
User
Dirs
.
Keys
)
{
foreach
(
var
dir
in
_expiredDirs
.
Keys
)
{
summary
+=
"\n - directory '"
+
dir
+
"'\n"
;
foreach
(
var
subdir
in
_expired
User
Dirs
[
dir
])
{
foreach
(
var
subdir
in
_expiredDirs
[
dir
])
{
summary
+=
$" -
{
subdir
.
Dir
.
Name
}
"
+
$"[age:
{
subdir
.
HumanAgeFromName
}
, "
+
$"size:
{
subdir
.
HumanSize
}
]\n"
;
...
...
@@ -147,8 +147,8 @@ namespace ATxCommon
expired
.
Add
(
dirDetails
);
}
if
(
expired
.
Count
>
0
)
_expiredUserDirs
.
Add
(
userdir
.
Name
,
expired
);
_expiredDirs
.
Add
(
userdir
.
Name
,
expired
);
}
foreach
(
var
drive
in
_drives
)
{
...
...
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