mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-14 02:28:23 +00:00
fix: [data_rentention_engine] fix object first/last seen
This commit is contained in:
parent
b0891f45ec
commit
7fa19efc1e
1 changed files with 6 additions and 2 deletions
|
@ -51,7 +51,7 @@ def get_obj_date_first(obj_type, subtype='', r_int=False):
|
||||||
first = r_obj.hget(f'date:first', f'{obj_type}:{subtype}')
|
first = r_obj.hget(f'date:first', f'{obj_type}:{subtype}')
|
||||||
if r_int:
|
if r_int:
|
||||||
if not first:
|
if not first:
|
||||||
return 0
|
return 99999999
|
||||||
else:
|
else:
|
||||||
return int(first)
|
return int(first)
|
||||||
return first
|
return first
|
||||||
|
@ -62,7 +62,7 @@ def get_obj_date_last(obj_type, subtype='', r_int=False):
|
||||||
last = r_obj.hget(f'date:last', f'{obj_type}:{subtype}')
|
last = r_obj.hget(f'date:last', f'{obj_type}:{subtype}')
|
||||||
if r_int:
|
if r_int:
|
||||||
if not last:
|
if not last:
|
||||||
return 99999999
|
return 0
|
||||||
else:
|
else:
|
||||||
return int(last)
|
return int(last)
|
||||||
return last
|
return last
|
||||||
|
@ -93,3 +93,7 @@ def update_obj_date(date, obj_type, subtype=''):
|
||||||
set_obj_date_last(date, obj_type, subtype=subtype)
|
set_obj_date_last(date, obj_type, subtype=subtype)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
print(r_obj.hgetall(f'date:first'))
|
||||||
|
print(r_obj.hgetall(f'date:last'))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue