Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mantid
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review 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
mantidproject
mantid
Commits
8519dcee
Commit
8519dcee
authored
6 years ago
by
Samuel Jones
Browse files
Options
Downloads
Patches
Plain Diff
Re #23570 Fix the poor merge
parent
79bb0205
Loading
Loading
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
MantidPlot/src/ApplicationWindow.cpp
+0
-3
0 additions, 3 deletions
MantidPlot/src/ApplicationWindow.cpp
MantidPlot/src/ProjectRecovery.cpp
+0
-55
0 additions, 55 deletions
MantidPlot/src/ProjectRecovery.cpp
MantidPlot/src/ProjectRecovery.h
+0
-3
0 additions, 3 deletions
MantidPlot/src/ProjectRecovery.h
with
0 additions
and
61 deletions
MantidPlot/src/ApplicationWindow.cpp
+
0
−
3
View file @
8519dcee
...
...
@@ -16813,9 +16813,6 @@ void ApplicationWindow::checkForProjectRecovery() {
m_projectRecovery.repairCheckpointDirectory();
// Mantid crashed during writing to this checkpoint so remove it
m_projectRecovery.removeLockedCheckpoints();
if (!m_projectRecovery.checkForRecovery()) {
m_projectRecovery.startProjectSaving();
return;
...
...
This diff is collapsed.
Click to expand it.
MantidPlot/src/ProjectRecovery.cpp
+
0
−
55
View file @
8519dcee
...
...
@@ -629,61 +629,6 @@ void ProjectRecovery::saveWsHistories(const Poco::Path &historyDestFolder) {
}
}
void
ProjectRecovery
::
removeOlderCheckpoints
()
{
// Currently set to a month in microseconds
const
int64_t
timeToDeleteAfter
=
2592000000000
;
std
::
string
recoverFolder
=
getRecoveryFolderCheck
();
// Get the PIDS
std
::
vector
<
Poco
::
Path
>
possiblePidsPaths
=
getListOfFoldersInDirectory
(
recoverFolder
);
// Order pids based on date last modified descending
std
::
vector
<
int
>
possiblePids
=
orderProcessIDs
(
possiblePidsPaths
);
// check if pid exists
std
::
vector
<
std
::
string
>
folderPaths
;
for
(
auto
i
=
0u
;
i
<
possiblePids
.
size
();
++
i
)
{
if
(
!
isPIDused
(
possiblePids
[
i
]))
{
std
::
string
folder
=
recoverFolder
;
folder
.
append
(
std
::
to_string
(
possiblePids
[
i
])
+
"/"
);
if
(
olderThanAGivenTime
(
Poco
::
Path
(
folder
),
timeToDeleteAfter
))
{
folderPaths
.
emplace_back
(
folder
);
}
}
}
bool
recurse
=
true
;
for
(
size_t
i
=
0
;
i
<
folderPaths
.
size
();
i
++
)
{
Poco
::
File
(
folderPaths
[
i
]).
remove
(
recurse
);
}
}
void
ProjectRecovery
::
removeLockedCheckpoints
()
{
std
::
string
recoverFolder
=
getRecoveryFolderCheck
();
// Get the PIDS
std
::
vector
<
Poco
::
Path
>
possiblePidsPaths
=
getListOfFoldersInDirectory
(
recoverFolder
);
// Order pids based on date last modified descending
std
::
vector
<
int
>
possiblePids
=
orderProcessIDs
(
possiblePidsPaths
);
// check if pid exists
std
::
vector
<
Poco
::
Path
>
files
;
for
(
auto
i
=
0u
;
i
<
possiblePids
.
size
();
++
i
)
{
if
(
!
isPIDused
(
possiblePids
[
i
]))
{
std
::
string
folder
=
recoverFolder
;
folder
.
append
(
std
::
to_string
(
possiblePids
[
i
])
+
"/"
);
auto
checkpointsInsidePIDs
=
getListOfFoldersInDirectory
(
folder
);
for
(
auto
c
:
checkpointsInsidePIDs
)
{
if
(
Poco
::
File
(
c
.
setFileName
(
LOCK_FILE_NAME
)).
exists
())
{
files
.
emplace_back
(
c
.
setFileName
(
""
));
}
}
}
}
bool
recurse
=
true
;
for
(
auto
c
:
files
)
{
Poco
::
File
(
c
).
remove
(
recurse
);
}
}
bool
ProjectRecovery
::
olderThanAGivenTime
(
const
Poco
::
Path
&
path
,
int64_t
elapsedTime
)
{
return
Poco
::
File
(
path
).
getLastModified
().
isElapsed
(
elapsedTime
);
...
...
This diff is collapsed.
Click to expand it.
MantidPlot/src/ProjectRecovery.h
+
0
−
3
View file @
8519dcee
...
...
@@ -88,9 +88,6 @@ public:
/// Looks at the recovery checkpoints and repairs some faults
void
repairCheckpointDirectory
();
/// Remove checkpoints if it has lock file
void
removeLockedCheckpoints
();
private:
/// Captures the current object in the background thread
std
::
thread
createBackgroundThread
();
...
...
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