Mercurial > noffle
comparison src/database.c @ 257:087e7039b569 noffle
[svn] * src/database.c: DB_compact() now does nothing. It was calling
gdbm_reorganize() which did rebuild on the database, copying it
to a new database and renaming. This now has an explicit function,
Db_rebuild(), and you don't want to chew disc space like this during
a routine expire.
author | bears |
---|---|
date | Wed, 26 Jun 2002 14:28:35 +0100 |
parents | 52f467c7213b |
children | 3477050e8d10 |
comparison
equal
deleted
inserted
replaced
256:b510f6a65a79 | 257:087e7039b569 |
---|---|
1 /* | 1 /* |
2 database.c | 2 database.c |
3 | 3 |
4 $Id: database.c 387 2002-06-26 13:15:44Z bears $ | 4 $Id: database.c 389 2002-06-26 13:28:35Z bears $ |
5 | 5 |
6 Uses GNU gdbm library. Using Berkeley db (included in libc6) was | 6 Uses GNU gdbm library. Using Berkeley db (included in libc6) was |
7 cumbersome. It is based on Berkeley db 1.85, which has severe bugs | 7 cumbersome. It is based on Berkeley db 1.85, which has severe bugs |
8 (e.g. it is not recommended to delete or overwrite entries with | 8 (e.g. it is not recommended to delete or overwrite entries with |
9 overflow pages). | 9 overflow pages). |
588 | 588 |
589 void | 589 void |
590 Db_compact( void ) | 590 Db_compact( void ) |
591 { | 591 { |
592 ASSERT( db.dbf ); | 592 ASSERT( db.dbf ); |
593 if ( gdbm_reorganize( db.dbf ) != 0 ) | 593 |
594 Log_err( "Error compacting article base: %s", errMsg() ); | 594 /* |
595 * You'd think it would be sensible to do something like | |
596 * | |
597 * if ( gdbm_reorganize( db.dbf ) != 0 ) | |
598 * Log_err( "Error compacting article base: %s", errMsg() ); | |
599 * | |
600 * here. But this just copies the database to a new one and renames, | |
601 * which is what Db_rebuild() does. | |
602 * | |
603 * So do nothing. We don't want expire to chew disc space. | |
604 */ | |
595 } | 605 } |
596 | 606 |
597 /* | 607 /* |
598 Helper functions for database rebuild. | 608 Helper functions for database rebuild. |
599 */ | 609 */ |