- client: delete sticky files when reset project

svn path=/trunk/boinc/; revision=25878
This commit is contained in:
David Anderson 2012-07-17 21:45:19 +00:00
parent aedbf28981
commit 028d4d9a36
2 changed files with 18 additions and 4 deletions

View File

@ -4979,3 +4979,9 @@ David 17 July 2012
api/
boinc_api.h
David 17 July 2012
- client: delete sticky files when reset project
client/
client_state.cpp

View File

@ -1726,12 +1726,11 @@ int CLIENT_STATE::report_result_error(RESULT& res, const char* format, ...) {
// - stop all active tasks
// - stop all file transfers
// - stop scheduler RPC if any
// - delete all workunits and results
// - delete all apps and app_versions
// - delete workunits and results
// - delete apps and app_versions
// - garbage collect to delete unneeded files
// - clear debts and backoffs
// - clear backoffs
//
// Note: does NOT delete persistent files or user-supplied files;
// does not delete project dir
//
int CLIENT_STATE::reset_project(PROJECT* project, bool detaching) {
@ -1784,6 +1783,15 @@ int CLIENT_STATE::reset_project(PROJECT* project, bool detaching) {
project->user_files.clear();
project->project_files.clear();
// clear flags so that sticky files get deleted
//
for (i=0; i<file_infos.size(); i++) {
FILE_INFO* fip = file_infos[i];
if (fip->project == project) {
fip->sticky = false;
}
}
garbage_collect_always();
// remove apps and app_versions (but not if anonymous platform)