• code modifications

    By Ulrich Krause 2 decades ago

    Hi,

    i wanted to have to have the RELOAD interval more dynamically. The interval is hardcoded in the source. If you want to change it, you have to recompile the code.

    OK, here is what I did so far.



    I added KS_RELOAD_INTERVAL=nnnn ( nnnn = time in seconds ) to the notes.ini



    I added the following lines to the kspam.c



    if( (difftime(time(NULL), g_tLastConfigLoad) > g_nReload_interval) && g_nReload ) {

     //g_bConfigured = FALSE;<br/>
    


     // added 21.06.2004 - eknori  <br/>
      ks_load_config();<br/>
      g_bConfigured = TRUE;<br/>
      LogEventText(&quot;kSpam: reloading rules&quot;, NULLHANDLE, NOERROR, NULL);<br/>
      g_nReload_interval = OSGetEnvironmentInt(&quot;KS_RELOAD_INTERVAL&quot;);<br/>
     // end <br/>
    



    }

    ===========================================================================================



    I defined g_nReload_interval in kspam.h



    //==================//

    // Global variables//

    //==================//



    DWORD g_dwConfigNotesFound; // Number of documents found

    time_t g_tLastConfigLoad; // Last time the config was loaded

    int g_nReload; // Reload



    int g_nReload_interval; // Reload after nn mins?



    int g_nSingleServer; // Single server install??



    ============================================================================================



    I load g_nReload_interval in void ks_load_env_vars()



    void ks_load_env_vars()



    .

    .

    .

    g_nReload_interval = OSGetEnvironmentInt("KS_RELOAD_INTERVAL");

    .

    .

    .



    Tom and the other project members; what do ya say ? Is this a way one could handle it ?