Skip to content
This repository was archived by the owner on Sep 6, 2022. It is now read-only.

Commit ed3f03a

Browse files
committed
solve cache issues on load_last_values
1 parent 3f19ef9 commit ed3f03a

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

PyTangoArchiving/hdbpp/query.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,12 @@ def get_partitions_at_dates(self, table, date1, date2=None):
155155

156156
def get_attr_timestamp(self, attr, method='max', epoch=None):
157157
try:
158-
return self.get_table_timestamp.execute(self,attr,method,epoch)
158+
return self.get_table_timestamp.func(self,attr,method,epoch)
159159
except Exception as e:
160160
self.warning('get_attr_timestamp(%s) failed!' % e)
161161
raise e #traceback.print_exc()
162162

163-
@Cached(depth=10000,expire=3600)
163+
@Cached(depth=10000,expire=600)
164164
def get_table_timestamp(self, table, method='max',
165165
epoch = None, ignore_errors = False): #, tref = -180*86400):
166166
"""
@@ -226,7 +226,8 @@ def get_last_attribute_values(self,attribute,n=1,
226226
"""
227227
if epoch is None:
228228
epoch = self.get_attr_timestamp(attribute,method='max')[0]
229-
elif epoch < 0:
229+
epoch += 3600
230+
if epoch < 0:
230231
epoch = fn.now()+epoch
231232

232233
start = (epoch or fn.now()) - abs(period)

0 commit comments

Comments
 (0)