mirror of https://github.com/BOINC/boinc.git
*** empty log message ***
svn path=/trunk/boinc/; revision=4946
This commit is contained in:
parent
7bcd27cf8d
commit
c60fb03c27
|
@ -21870,3 +21870,11 @@ David 27 Dec 2004
|
|||
setup_project.py
|
||||
sched/
|
||||
db_purge.C
|
||||
|
||||
David 27 Dec 2004
|
||||
- small fixes
|
||||
|
||||
html/inc/
|
||||
uotd.inc
|
||||
sched/
|
||||
db_purge.C
|
||||
|
|
|
@ -38,6 +38,7 @@ function get_current_uotd() {
|
|||
// Either way, generate the UOTD page
|
||||
//
|
||||
function build_uotd_page() {
|
||||
echo date("F d Y", time())."\n";
|
||||
$current_uotd = get_current_uotd();
|
||||
if ($current_uotd) {
|
||||
$assigned = getdate($current_uotd->uotd_time);
|
||||
|
@ -45,6 +46,7 @@ function build_uotd_page() {
|
|||
if ($assigned['mday'] == $now['mday']) {
|
||||
$user = lookup_user_id($current_uotd->userid);
|
||||
generate_uotd_page($current_uotd, $user);
|
||||
echo "Already have UOTD for today\n";
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
@ -65,12 +67,15 @@ function build_uotd_page() {
|
|||
}
|
||||
|
||||
if ($result && mysql_num_rows($result) == 0) {
|
||||
// If all verified profiles have been selected as UOTD, reshow the one that was shown least recently.
|
||||
// If all verified profiles have been selected as UOTD,
|
||||
// reshow the one that was shown least recently.
|
||||
//
|
||||
$result = mysql_query("SELECT * FROM profile WHERE verification = 1 ORDER BY uotd_time ASC LIMIT 1");
|
||||
}
|
||||
|
||||
if (!$result || mysql_num_rows($result) == 0) {
|
||||
// No valid users of the day - do something.
|
||||
echo "No screened users found\n";
|
||||
exit();
|
||||
}
|
||||
$profile = mysql_fetch_object($result);
|
||||
|
@ -86,6 +91,7 @@ function build_uotd_page() {
|
|||
. PROJECT . " user of the day!
|
||||
Your profile will be featured on the " . PROJECT . " website for the next 24 hours."
|
||||
);
|
||||
echo "Chose user $user->id as UOTD\n";
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -108,7 +108,7 @@ int max_number_workunits_to_purge=0;
|
|||
char *suffix[3]={"", ".gz", ".zip"};
|
||||
|
||||
// default is no compression
|
||||
int compress=COMPRESSION_NONE;
|
||||
int compression_type=COMPRESSION_NONE;
|
||||
|
||||
// set on command line if archive files should be closed and re-opened
|
||||
// after getting some max no of WU in the file
|
||||
|
@ -134,14 +134,14 @@ void open_archive(char* filename_prefix, FILE*& f){
|
|||
|
||||
// append appropriate suffix for file type
|
||||
sprintf(path, "../archives/%s_%d.xml", filename_prefix, time_int);
|
||||
strcat(path, suffix[compress]);
|
||||
strcat(path, suffix[compression_type]);
|
||||
|
||||
// and construct appropriate command if needed
|
||||
if (compress==COMPRESSION_GZIP) {
|
||||
if (compression_type==COMPRESSION_GZIP) {
|
||||
sprintf(command, "gzip - > %s", path);
|
||||
}
|
||||
|
||||
if (compress==COMPRESSION_ZIP) {
|
||||
if (compression_type==COMPRESSION_ZIP) {
|
||||
sprintf(command, "zip %s -", path);
|
||||
}
|
||||
|
||||
|
@ -150,7 +150,7 @@ void open_archive(char* filename_prefix, FILE*& f){
|
|||
// in the case with no compression, just open the file, else open
|
||||
// a pipe to the compression executable.
|
||||
//
|
||||
if (compress==COMPRESSION_NONE) {
|
||||
if (compression_type==COMPRESSION_NONE) {
|
||||
if (!(f = fopen( path,"w"))) {
|
||||
log_messages.printf(
|
||||
SCHED_MSG_LOG::CRITICAL,"Can't open archive file %s %s\n",
|
||||
|
@ -183,7 +183,7 @@ void close_archive(char *filename, FILE*& fp){
|
|||
|
||||
// In case of errors, carry on anyway. This is deliberate, not lazy
|
||||
//
|
||||
if (compress==COMPRESSION_NONE) {
|
||||
if (compression_type==COMPRESSION_NONE) {
|
||||
fclose(fp);
|
||||
} else {
|
||||
pclose(fp);
|
||||
|
@ -193,7 +193,7 @@ void close_archive(char *filename, FILE*& fp){
|
|||
|
||||
// append appropriate file type
|
||||
sprintf(path, "../archives/%s_%d.xml", filename, time_int);
|
||||
strcat(path, suffix[compress]);
|
||||
strcat(path, suffix[compression_type]);
|
||||
|
||||
log_messages.printf(SCHED_MSG_LOG::NORMAL,
|
||||
"Closed archive file %s containing records of %d workunits\n",
|
||||
|
@ -549,9 +549,9 @@ int main(int argc, char** argv) {
|
|||
} else if (!strcmp(argv[i], "-max")) {
|
||||
max_number_workunits_to_purge= atoi(argv[++i]);
|
||||
} else if (!strcmp(argv[i], "-zip")) {
|
||||
compress=COMPRESSION_ZIP;
|
||||
compression_type=COMPRESSION_ZIP;
|
||||
} else if (!strcmp(argv[i], "-gzip")) {
|
||||
compress=COMPRESSION_GZIP;
|
||||
compression_type=COMPRESSION_GZIP;
|
||||
} else if (!strcmp(argv[i], "-max_wu_per_file")) {
|
||||
max_wu_per_file = atoi(argv[++i]);
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue