Commit 3f016a79 authored by Anael Beutot's avatar Anael Beutot
Browse files

Refresh handling for tag_inspector.

parent 9c1807b2
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -95,9 +95,11 @@ def tag_inspector(mod, parent=None):
        elif isinstance(m, (str, unicode)):
            # if string, it means it is constant, then ttl = -1
            ttl = -1
            refresh = None
        elif inspect.isfunction(m):
            # if function take function ttl argument or set -1 by default
            ttl = getattr(m, 'ttl', -1)
            refresh = getattr(m, 'refresh', None)
        else:
            # whatever it is we don't care...
            continue
@@ -105,7 +107,7 @@ def tag_inspector(mod, parent=None):
        logger.debug('Introspected %s with ttl %s.', n, ttl)

        # finally add the tag
        tags.append(Tag(n, m, ttl, parent))
        tags.append(Tag(n, m, ttl, refresh, parent))

    return tags