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

Commit fa36522

Browse files
committed
solve error on get_attributes() cache
1 parent 783a164 commit fa36522

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

PyTangoArchiving/reader.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -247,9 +247,8 @@ class Reader(Object,SingletonMap):
247247
#cls.__singleton__ = cls(*p,**k)
248248
#return cls.__singleton__
249249

250-
RetentionPeriod = 3*24*3600
251-
ExportPeriod = 600
252-
CacheTime = 600
250+
RetentionPeriod = 3*24*3600 # for TDB compatibility
251+
ExportPeriod = 600 # for TDB compatibility
253252
DefaultSchemas = ['hdb','tdb',] #'snap',)
254253
#'*','all') @TODO: Snap should be readable by Reader
255254
ValidArgs = ['db','config','servers','schema','timeout',
@@ -575,13 +574,9 @@ def get_attributes(self,active=False,regexp=''):
575574
active: True/False: attributes currently archived
576575
regexp: '' :filter for attributes to retrieve
577576
"""
578-
self.log.debug('get_attributes(%s)'%active)
577+
self.log.debug('get_attributes(%s,%s)' % (active,regexp))
579578
t0 = now()
580579

581-
if self.available_attributes and self.current_attributes \
582-
and time.time()<(self.updated+self.CacheTime):
583-
return (self.available_attributes,self.current_attributes)[active]
584-
585580
self.log.debug('%s: In Reader(%s).get_attributes(): '
586581
'last update was at %s'%(time.ctime(),self.schema,self.updated))
587582
self.log.debug('multihost = %s' % self.multihost)
@@ -650,6 +645,7 @@ def get_attributes(self,active=False,regexp=''):
650645
% (self.schema,len(self.available_attributes),self.updated-t0))
651646

652647
r = (self.available_attributes,self.current_attributes)[active]
648+
self.log.debug('get_attributes(%s,%s)' % (len(r), regexp))
653649
return sorted(fn.filtersmart(r,regexp) if regexp else r)
654650

655651
#@Cached(depth=10000,expire=86400)

0 commit comments

Comments
 (0)