/*
+ * $Id$
+ *
* This file contains housekeeping tasks which periodically
* need to be executed. It keeps a nice little queue...
*
- * $Id$
*/
#include "sysdep.h"
#include "housekeeping.h"
#include "sysdep_decls.h"
#include "room_ops.h"
+#include "database.h"
int housepipe[2]; /* This is the queue for housekeeping tasks */
}
extract(cmd, house_cmd, 0);
+ cdb_begin_transaction();
/* Do whatever this cmd requires */
lprintf(7, "Unknown housekeeping command\n");
}
+ cdb_end_transaction();
+
} while (did_something);
}
}
++flbuf.f_ref_count;
flbuf.f_flags = flbuf.f_flags | QR_INUSE;
putfloor(&flbuf, qrbuf->QRfloor);
- }
+}
void check_ref_counts(void) {
struct floor flbuf;
int a;
+ lprintf(7, "Checking floor reference counts\n");
for (a=0; a<MAXFLOORS; ++a) {
getfloor(&flbuf, a);
flbuf.f_ref_count = 0;
flbuf.f_flags = flbuf.f_flags & ~QR_INUSE;
putfloor(&flbuf, a);
- }
+ }
ForEachRoom(check_ref_counts_backend, NULL);
- }
+}