Skip to content

Commit

Permalink
Tiny cleanup of maddavo plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
kfsone committed Dec 29, 2014
1 parent 4980ee5 commit c0052d2
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions plugins/maddavo_plug.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,16 +158,13 @@ def run(self):

tdenv.ignoreUnknown = True

if cacheNeedsRebuild:
tdb = tdb
# Make sure we disconnect from the db
if tdb.conn:
tdb.conn.close()
tdb.conn = tdb.cur = None
tdb.reloadCache()
tdb.load(
maxSystemLinkLy=tdenv.maxSystemLinkLy,
)
# Let the system decide if it needs to reload-cache
tdb.close()
tdb.reloadCache()
tdb.load(
maxSystemLinkLy=tdenv.maxSystemLinkLy,
)
tdb.close()

# Scan the file for the latest data.
firstDate = None
Expand All @@ -186,6 +183,7 @@ def run(self):
for line in fh:
if line.startswith('@'):
lastStn = line[2:-1]
continue
if not line.startswith(' ') or len(line) < minLen:
continue
m = dateRe.search(line)
Expand Down

0 comments on commit c0052d2

Please sign in to comment.