From: Enrico A. <an...@na...> - 2007-05-28 14:54:12
|
Ho aggiornato il cvs con delle sostanziali modifiche alla parte =20 preposta all'invio di email per i sondaggi: la routine usata (sia =20 all'apertura del sondaggio che al reminder di un sondaggio gia' =20 aperto) aveva problemi nell'invio di un quantitativo di email =20 superiore a 200, in quanto la procedura non era scollegata dalla =20 generazione della pagina e ciclando sull'invio delle mail ad un certo =20 punto incontrava il timeout interno del webserver causando =20 l'interruzione della procedura. Inoltre non c'era nessun controllo per =20 evitare di piantare la macchina che esegue sendmail con troppi =20 processi aperti. Per ovviare a questi inconvenienti ho riscritto completamente quella =20 parte, creando un apposito modulo perl (Safe::Sendmail) che ricalca le =20 procedure di invio in massa utilizzate da Sympa, in modo da usare cose =20 gia' ampiamente collaudate per volumi di mail maggiori di 30000. Inoltre la parte che alla pressione di "Invia Email" rimaneva appesa =20 causando il timeout, ora effettua un fork di un processo perl, che a =20 sua volta cicla sugli utenti trovati nel db ed iscritti al sondaggio =20 corrente: per questo l'utente avra' immediatamente una pagina di =20 conferma dell'operazione, con un link che rimanda ad un file html che =20 viene generato dalla procedura in background: aprendo questo link e =20 facendo refresh l'utente potra' seguire il progresso dell'invio delle =20 email; questa parte e' ancora ampiamente migliorabile, accetto =20 suggerimenti in proposito: lo scopo di questa update pero' e' =20 soprattutto quello di risolvere il bug che impediva di fatto l'invio =20 di email di notifica e/o reminder per sondaggi con piu' di 200 iscritti. Un log delle operazioni si potra' trovare in /tmp/safesendemail.log: =20 anche questa parte e' modificabile facilmente. Per installare i nuovi files su una installazione gia esistente, =20 effettuate le seguenti operazioni: 1) checkout dell'ultimo CVS sia di Partecipa.base che di Partecipa.poll 2) Entrare nella directory <Partecipa.base_cvs_dir>/src/modules/Safe 3) Eseguire i comandi perl Makefile.PL; make test; make; make install 4) Copiare i seguenti files: <Partecipa.base_cvs_dir>/src/common/lib/functions/misc-utils.pl =3D> =20 <install_dir>/partecipa.base/lib/functions/misc-utils.pl <Partecipa.poll_cvs_dir>/src/pub/templates/admin_phpESP_sendEmailResult.temp= late =20 =3D> <install_dir>/partecipa.base/lib/servers/pub/templates/admin_phpESP_sendEmai= lResult.template <Partecipa.poll_cvs_dir>/src/pub/forms/admin_phpESP_sendEmail.form =3D> =20 <install_dir>/partecipa.base/lib/servers/pub/forms/admin_phpESP_sendEmail.fo= rm <Partecipa.poll_cvs_dir>/src/pub/cmds/admin_phpESP_sendSurveyEmail.uxu =20 =3D> =20 <install_dir>/partecipa.base/lib/servers/pub/cmds/admin_phpESP_sendSurveyEma= il.uxu |