Sort statewise results
This commit is contained in:
parent
c94b291d39
commit
b8c2b1b86a
@ -77,21 +77,27 @@ class Store:
|
|||||||
return (s, v,)
|
return (s, v,)
|
||||||
|
|
||||||
|
|
||||||
def by_state(self, state=0, limit=4096, strict=False, threshold=None):
|
def by_state(self, state=0, not_state=0, limit=4096, strict=False, threshold=None):
|
||||||
hashes = []
|
hashes = []
|
||||||
i = 0
|
i = 0
|
||||||
|
|
||||||
refs_state = self.state_store.list(state)
|
refs_state = self.state_store.list(state)
|
||||||
|
refs_state.sort()
|
||||||
|
|
||||||
for ref in refs_state:
|
for ref in refs_state:
|
||||||
v = from_key(ref)
|
v = from_key(ref)
|
||||||
hsh = v[2]
|
hsh = v[2]
|
||||||
|
|
||||||
|
item_state = self.state_store.state(ref)
|
||||||
|
|
||||||
if strict:
|
if strict:
|
||||||
item_state = self.state_store.state(ref)
|
|
||||||
if item_state & state != item_state:
|
if item_state & state != item_state:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
logg.info('state {} {}'.format(ref, item_state))
|
||||||
|
if item_state & not_state > 0:
|
||||||
|
continue
|
||||||
|
|
||||||
if threshold != None:
|
if threshold != None:
|
||||||
v = self.state_store.modified(ref)
|
v = self.state_store.modified(ref)
|
||||||
if v > threshold:
|
if v > threshold:
|
||||||
|
Loading…
Reference in New Issue
Block a user