From 563db0cbe5a438d44d763d84cf7bf01528765a59 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 3 Jan 2003 22:17:40 +0000 Subject: [PATCH] make_work svn path=/trunk/boinc/; revision=795 --- db/constraints.sql | 31 +++++++++++++++---------------- sched/make_work.C | 6 +++--- 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/db/constraints.sql b/db/constraints.sql index be6fb534a9..39da0c66f3 100644 --- a/db/constraints.sql +++ b/db/constraints.sql @@ -10,27 +10,26 @@ alter table app_version add unique(appid, platformid, version_num); alter table user - add unique(email_addr); -alter table user - add unique(authenticator); -alter table user - add index ind_tid (teamid); -create index user_avg on user(expavg_credit); + add unique(email_addr), + add unique(authenticator), + add index ind_tid (teamid), + add index user_avg (expavg_credit); alter table team add unique(name); alter table workunit - add unique(name); -create index wu_val on workunit(appid, need_validate); -create index wu_retry on workunit(appid, retry_check_time); -create index wu_filedel on workunit(file_delete_state); -create index wu_assim on workunit(appid, assimilate_state); + add unique(name), + add index wu_val (appid, need_validate), + add index wu_retry (appid, retry_check_time), + add index wu_filedel (file_delete_state), + add index wu_assim (appid, assimilate_state); alter table result - add unique(name); -create index res_wuid on result(workunitid); -create index ind_res_st on result(server_state); -create index res_filedel on result(file_delete_state); + add unique(name), + add index res_wuid (workunitid), + add index ind_res_st (server_state), + add index res_filedel (file_delete_state); -create index host_avg on host(expavg_credit); +alter table host + add index host_avg (expavg_credit); diff --git a/sched/make_work.C b/sched/make_work.C index 7078000ffe..835a82f3f1 100644 --- a/sched/make_work.C +++ b/sched/make_work.C @@ -156,7 +156,7 @@ void make_work() { while (p) { if (parse_str(p, "", file_name, sizeof(file_name))) { sprintf( - new_file_name, "%s_%d_%d", file_name, start_time, i++ + new_file_name, "%s_%d_%d", file_name, start_time, seqno++ ); sprintf(pathname, "%s/%s", config.download_dir, file_name); sprintf( @@ -166,7 +166,7 @@ void make_work() { if (system(command)) { fprintf(stderr, "make_work: ERROR\n"); perror(command); - exit(); + exit(1); } strcpy(new_buf, starting_xml); replace_file_name( @@ -177,7 +177,7 @@ void make_work() { p = strtok(0, "\n"); } nresults_left = redundancy; - sprintf(wu.name, "wu_%d_%d", start_time, seqno); + sprintf(wu.name, "wu_%d_%d", start_time, seqno++); wu.id = 0; wu.create_time = time(0); retval = db_workunit_new(wu);