Branch: Tag:

2003-01-27

2003-01-27 15:10:10 by Mattias Andersson <matan@lysator.liu.se>

New features in 3.4, like renaming of profiles and indexing of any sitebuilder metadata, and updated version of wvWare.

Rev: lib/modules/Search.pmod/Database.pmod/Base.pmod:1.19
Rev: lib/modules/Search.pmod/Database.pmod/MySQL.pike:1.75
Rev: lib/modules/Search.pmod/Filter.pmod/PDF.pmod:1.13
Rev: lib/modules/Search.pmod/Filter.pmod/Word.pmod:1.10
Rev: lib/modules/Search.pmod/Filter.pmod/wvHtml.xml:1.3
Rev: lib/modules/Search.pmod/Process.pmod:1.10
Rev: lib/modules/Search.pmod/Utils.pmod:1.36

1:   // This file is part of Roxen Search   // Copyright © 2001 Roxen IS. All rights reserved.   // - // $Id: Utils.pmod,v 1.35 2002/03/07 13:10:49 js Exp $ + // $Id: Utils.pmod,v 1.36 2003/01/27 15:10:09 mattias Exp $      #if !constant(report_error)   #define report_error werror
451:    private mapping(int:int) crawl_queue;    private mapping(int:int) compact_queue;    private mapping db_profiles; +  private object schedule_process;       void create(mapping _db_profiles) {    db_profiles = _db_profiles;
511:    reschedule();    }    + #if constant (roxen) +  private void reschedule() { +  if( schedule_process ) +  schedule_process->stop(); +  WERR("Scheduler runs next event in "+(next_run-time())+" seconds."); +  schedule_process = +  roxen.BackgroundProcess(next_run-time(), do_scheduled_stuff); +  } +  +  void unschedule() { +  if( schedule_process ) +  schedule_process->stop(); +  } +  +     private void do_scheduled_stuff() { -  +  if( schedule_process ) +  schedule_process->stop(); +  WERR("Running scheduler event."); +  +  int t = time(); +  +  WERR(sizeof(crawl_queue)+" profiles in crawl queue."); +  foreach(indices(crawl_queue), int id) { +  if(crawl_queue[id]>t || !db_profiles[id]) continue; +  object dbp = db_profiles[id]; +  if(dbp && dbp->ready_to_crawl()) { +  WERR("Scheduler starts crawling "+id); +  dbp->start_indexer(); +  } +  } +  +  WERR(sizeof(compact_queue)+" profiles in compact queue."); +  foreach(indices(compact_queue), int id) { +  if(compact_queue[id]>t || !db_profiles[id]) continue; +  db_profiles[id]->start_compact(); +  } +  +  schedule(); +  } +  + #else +  private void reschedule() {    remove_call_out(do_scheduled_stuff); -  +  WERR("Scheduler runs next event in "+(next_run-time())+" seconds."); +  call_out(do_scheduled_stuff, next_run-time()); +  } +  +  void unschedule() { +  remove_call_out(do_scheduled_stuff); +  } +  +  private void do_scheduled_stuff() { +  remove_call_out(do_scheduled_stuff);    WERR("Running scheduler event.");       int t = time();
536:    schedule();    }    + #endif +     string info() {    string res = "<table border='1' cellspacing='0' cellpadding='2'>"    "<tr><th>Profile</th><th>Crawl</th>"