* Network run frequency is now a site-definable setting
authorArt Cancro <ajc@citadel.org>
Wed, 14 Nov 2001 02:59:02 +0000 (02:59 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 14 Nov 2001 02:59:02 +0000 (02:59 +0000)
citadel/ChangeLog
citadel/citadel.h
citadel/config.c
citadel/control.c
citadel/routines2.c
citadel/serv_network.c
citadel/sysconfig.h

index 1c8ae9b477460b5622c4da7aac1c24cf4288f170..dd3821b935d5aa0c4fcd3f8bc455f91b0c25b7b4 100644 (file)
@@ -1,4 +1,7 @@
  $Log$
+ Revision 580.74  2001/11/14 02:59:01  ajc
+ * Network run frequency is now a site-definable setting
+
  Revision 580.73  2001/11/13 22:05:23  ajc
  * Re-introduced the ability to enter IGnet mail into the system.
 
@@ -2852,3 +2855,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import 
+
index df0c9363937d34dd383e66594ea76c3d3d0d8966..6ab28d50abffe5fa5a9eb6a68a975b1b0c0bd29b 100644 (file)
@@ -105,6 +105,7 @@ struct config {
        int c_default_filter;           /* Default moderation filter level  */
        int c_aide_zap;                 /* Are Aides allowed to zap rooms?  */
        int c_imap_port;                /* IMAP listener port (usually 143) */
+       time_t c_net_freq;              /* how often to run the networker   */
 };
 
 #define NODENAME               config.c_nodename
index 534eb58d94f85fc786b8189926d649807a980747..117f2bf2c8414d2ffd37a4c2d3e18ebeb2a0a331 100644 (file)
@@ -98,6 +98,12 @@ void get_config(void) {
 
        if (config.c_max_workers < config.c_min_workers)   /* max >= min */
                config.c_max_workers = config.c_min_workers;
+
+       /* Networking more than once every five minutes just isn't sane */
+       if (config.c_net_freq == 0L)
+               config.c_net_freq = 3600L;      /* once per hour default */
+       if (config.c_net_freq < 300L) 
+               config.c_net_freq = 300L;
 }
 
 
index a60edf19c679a34a17b5f5c604a345203d816575..2b887b60a74f5e70b6041fc135bdffac02adc90e 100644 (file)
@@ -186,6 +186,7 @@ void cmd_conf(char *argbuf) {
                cprintf("%d\n", config.c_default_filter);
                cprintf("%d\n", config.c_aide_zap);
                cprintf("%d\n", config.c_imap_port);
+               cprintf("%d\n", config.c_net_freq);
                cprintf("000\n");
                }
 
@@ -277,6 +278,8 @@ void cmd_conf(char *argbuf) {
                                break;
                        case 27: config.c_imap_port = atoi(buf);
                                break;
+                       case 28: config.c_net_freq = atol(buf);
+                               break;
                        }
                    ++a;
                    }
index 7d23e9bb6e97e5495e7c26e1d97813b0a0dd63ed..8257176d9699d60aed9e35187dea17065fbea0bb 100644 (file)
@@ -646,7 +646,7 @@ void read_bio(void)
 void do_system_configuration(void)
 {
        char buf[SIZ];
-       char sc[28][SIZ];
+       char sc[29][SIZ];
        int expire_mode = 0;
        int expire_value = 0;
        int a;
@@ -661,8 +661,9 @@ void do_system_configuration(void)
        if (buf[0] == '1') {
                a = 0;
                while (serv_gets(buf), strcmp(buf, "000")) {
-                       if (a < 28)
+                       if (a < 29) {
                                strcpy(&sc[a][0], buf);
+                       }
                        ++a;
                }
        }
@@ -686,7 +687,10 @@ void do_system_configuration(void)
        strprompt("Geographic location of this system", &sc[12][0], 31);
        strprompt("Name of system administrator", &sc[13][0], 25);
        strprompt("Paginator prompt", &sc[10][0], 79);
-       /* strprompt("Default moderation filter for new users", &sc[25][0], 4); */
+
+       /* this prompt is commented out until we finish the moderation system
+       strprompt("Default moderation filter for new users", &sc[25][0], 4);
+       */
 
        /* Security parameters */
 
@@ -729,12 +733,16 @@ void do_system_configuration(void)
        strprompt("Maximum message length", &sc[20][0], 20);
        strprompt("Minimum number of worker threads", &sc[21][0], 3);
        strprompt("Maximum number of worker threads", &sc[22][0], 3);
+
+       /* no longer applicable ... deprecated
        strprompt("Server-to-server networking password", &sc[15][0], 19);
+       */
+
+       strprompt("How often to run network jobs (in seconds)", &sc[28][0], 5);
        strprompt("SMTP server port (-1 to disable)", &sc[24][0], 5);
        strprompt("POP3 server port (-1 to disable)", &sc[23][0], 5);
        strprompt("IMAP server port (-1 to disable)", &sc[27][0], 5);
 
-
        /* Expiry settings */
        strprompt("Default user purge time (days)", &sc[16][0], 5);
        strprompt("Default room purge time (days)", &sc[17][0], 5);
@@ -770,7 +778,7 @@ void do_system_configuration(void)
                serv_puts("CONF set");
                serv_gets(buf);
                if (buf[0] == '4') {
-                       for (a = 0; a < 28; ++a)
+                       for (a = 0; a < 29; ++a)
                                serv_puts(&sc[a][0]);
                        serv_puts("000");
                }
index 382fdc22bcc3f7344d0f5f234edde6cb284ce287..d902433fefbd0feee72c4b46b99b1eb57d60f780 100644 (file)
@@ -1293,7 +1293,7 @@ void network_do_queue(void) {
        /*
         * Run no more frequently than once every n seconds
         */
-       if ( (time(NULL) - last_run) < NETWORK_QUEUE_FREQUENCY ) return;
+       if ( (time(NULL) - last_run) < config.c_net_freq ) return;
 
        /*
         * This is a simple concurrency check to make sure only one queue run
index 34b722cdfae633f270712f8177bc28bd74d82ba5..588796f48d1960dfb837e47e828342b66dee166f 100644 (file)
 #define SMTP_RETRY_MAX         43200   /* 12 hours */
 #define SMTP_GIVE_UP           432000  /* 5 days */
 
-/*
- * How often to run the networker
- */
-#define NETWORK_QUEUE_FREQUENCY 3600   /* Once per hour */
-
 /*
  * Who bounced messages appear to be from
  */