'Clean the transient records.
This unlinks old records from the transient model tables whenever the
"_transient_max_count" or "_max_age" conditions (if any) are reached.
Actual cleaning will happen only once every "_transient_check_time" calls.
This means this method can be called frequently called (e.g. whenever
a new record is created).
Example with both max_hours and max_count active:
Suppose max_hours = 0.2 (e.g. 12 minutes), max_count = 20, there are 55 rows in the
table, 10 created/changed in the last 5 minutes, an additional 12 created/changed between
5 and 10 minutes ago, the rest created/changed more then 12 minutes ago.
- age based vacuum will leave the 22 rows created/changed in the last 12 minutes
- count based vacuum will wipe out another 12 rows. Not just 2, otherwise each addition
would immediately cause the maximum to be reached again.
- the 10 rows that have been created/changed the last 5 minutes will NOT be deleted'

@api.model
def _transient_vacuum(self, force=False):

    assert self._transient, ('Model    %s    is    not    transient,    it    cannot    be    vacuumed!' % self._name)
    _transient_check_time = 20
    cls = type(self)
    cls._transient_check_count += 1
    if ((not force) and (cls._transient_check_count < _transient_check_time)):
        return True
    cls._transient_check_count = 0
    if self._transient_max_hours:
        self._transient_clean_rows_older_than(((self._transient_max_hours * 60) * 60))
    if self._transient_max_count:
        self._transient_clean_old_rows(self._transient_max_count)
    return True
