How do we know the Branch was retrieved from the database and not the
Storm cache?
I also don't see any commits. Both of these issues can be fixed in the
schema-lazr.conf - set the isolation level to autocommit and the
storm_cache_size to 0 for this component.
> How about:
>
> result = self.store.find(
> (Branch.id, Branch.unique_name),
> Branch.unique_name.is_in(prefixes), Branch.private == False).one()
>
> That way result should be None if not found, and a tuple of id and unique_name
> if it was found.
>
> That'll make this code a little cleaner.
Shouldn't that be .any()? .one() will explode if multiple rows matched.
On Wed, Jul 22, 2009 at 11:27 AM, Tim Penhey<email address hidden> wrote: IStoreSelector) .get(MAIN_ STORE,
>> + self.store = getUtility(
> SLAVE_FLAVOR)
You can spell this 'self.store = ISlaveStore( Branch) ' which I think is
nicer and more meaningful.
>> + if prefix in self._cache: codehosting. branch_ rewrite_ cache_lifetime) : len(prefix) + 1:] append( prefix) unique_ name.is_ in(prefixes) , Branch.private == False) unique_ name).next( )
>> + branch_id, inserted_time = self._cache[prefix]
>> + if (self._now() < inserted_time +
>> + config.
>> + trailing = location[
>> + return branch_id, trailing, "HIT"
>> + prefixes.
>> + result = self.store.find(
>> + Branch,
>> + Branch.
>> + try:
>> + branch_id, unique_name = result.values(
>> + Branch.id, Branch.
>> + except StopIteration:
>> + return None, None, "MISS"
How do we know the Branch was retrieved from the database and not the
Storm cache?
I also don't see any commits. Both of these issues can be fixed in the
schema-lazr.conf - set the isolation level to autocommit and the
storm_cache_size to 0 for this component.
> How about: unique_ name), unique_ name.is_ in(prefixes) , Branch.private == False).one()
>
> result = self.store.find(
> (Branch.id, Branch.
> Branch.
>
> That way result should be None if not found, and a tuple of id and unique_name
> if it was found.
>
> That'll make this code a little cleaner.
Shouldn't that be .any()? .one() will explode if multiple rows matched.
-- www.stuartbisho p.net/
Stuart Bishop <email address hidden>
http://