openerp-india team mailing list archive
-
openerp-india team
-
Mailing list archive
-
Message #16993
[Bug 1009014] Re: vacuum on transient model cannot work
** Branch linked: lp:~therp-nl/openobject-
server/ronald@therp.nl_6.1_lp1009014_new-6.1
--
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Server.
https://bugs.launchpad.net/bugs/1009014
Title:
vacuum on transient model cannot work
Status in OpenERP Server:
Confirmed
Status in Therp Backports:
Fix Released
Bug description:
For transient models there are some methods to automatically unlink
old records, based on age or a count of records.
At the same time there is logic that is intended to only cleanup older
records, after the vaccum function has been called a number of times.
The vacuum function is called:
- from a cronjob
- on each create call on a transient model
problem is that te counter to prevent too frequent calls, is reset on
every call. Therefore vacuum cleaning never gets done:
self._transient_check_count += 1
if (not force) and (self._transient_check_count % self._transient_check_time):
self._transient_check_count = 0
return True
This problem masks another problem: if configuration is based on a
maximum count of records, then when cleaning is done ALL existing
records will be deleted. This might not be a problem is only one user
is using the transient model at that time. But with multiple users,
this is bound to result in errors...
Therefore:
- the counter should ONLY be reset when actual cleaning is done.
- cleaning on number of records should leave a minimum amount of records, or alternatively, only delete records that have not been changed in say 10 minutes.
I will create a branch containing these changes...
To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-server/+bug/1009014/+subscriptions
References