*** empty log message ***

svn path=/trunk/boinc/; revision=4362
This commit is contained in:
Lana Alber 2004-10-20 20:54:14 +00:00
parent 73eec1d3ec
commit 2538b63c6f
1 changed files with 12 additions and 1 deletions

View File

@ -62,6 +62,10 @@ FILE *wu_index_stream;
FILE *re_index_stream; FILE *re_index_stream;
int time_int; int time_int;
int purged_workunits= 0, purged_results= 0,
max_number_workunits_to_purge;
int open_archive(char* filename_prefix, FILE*& f){ int open_archive(char* filename_prefix, FILE*& f){
int retval=0; int retval=0;
char path[256]; char path[256];
@ -263,7 +267,6 @@ int purge_and_archive_results(DB_WORKUNIT& wu, int& number_results) {
// return nonzer if did anything // return nonzer if did anything
// //
bool do_pass() { bool do_pass() {
int purged_workunits= 0, purged_results= 0;
int retval= 0; int retval= 0;
check_stop_daemons(); check_stop_daemons();
@ -301,6 +304,10 @@ bool do_pass() {
log_messages.printf(SCHED_MSG_LOG::CRITICAL,"Purged workunit [%d] from database\n", wu.id); log_messages.printf(SCHED_MSG_LOG::CRITICAL,"Purged workunit [%d] from database\n", wu.id);
purged_workunits++; purged_workunits++;
if (purged_workunits >= max_number_workunits_to_purge)
break;
} }
log_messages.printf(SCHED_MSG_LOG::CRITICAL, log_messages.printf(SCHED_MSG_LOG::CRITICAL,
@ -324,6 +331,8 @@ int main(int argc, char** argv) {
one_pass = true; one_pass = true;
} else if (!strcmp(argv[i], "-d")) { } else if (!strcmp(argv[i], "-d")) {
log_messages.set_debug_level(atoi(argv[++i])); log_messages.set_debug_level(atoi(argv[++i]));
} else if (!strcmp(argv[i], "-max")) {
max_number_workunits_to_purge= atoi(argv[++i]);
} else { } else {
log_messages.printf(SCHED_MSG_LOG::CRITICAL, log_messages.printf(SCHED_MSG_LOG::CRITICAL,
"Unrecognized arg: %s\n", "Unrecognized arg: %s\n",
@ -395,6 +404,8 @@ int main(int argc, char** argv) {
do_pass(); do_pass();
} else { } else {
while (1) { while (1) {
if (purged_workunits >= max_number_workunits_to_purge)
break;
if (!do_pass()) sleep(10); if (!do_pass()) sleep(10);
} }
} }