Skip to content

Commit

Permalink
Backport (#1237) with fixes from #1302
Browse files Browse the repository at this point in the history
  • Loading branch information
buger committed Nov 20, 2017
1 parent 191a245 commit cb47d36
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 0 additions & 1 deletion coprocess/python/dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,5 +146,4 @@ def reload(self):
self.purge_event_handlers()
self.load_event_handlers()

self.purge_middlewares()
self.load_middlewares()
5 changes: 3 additions & 2 deletions coprocess/python/tyk/middleware.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from importlib import import_module
from importlib import reload as reload_module
from importlib import invalidate_caches as invalidate_caches
from importlib.machinery import SourceFileLoader

import inspect, sys
import tyk.decorators as decorators
Expand All @@ -16,7 +16,8 @@ def __init__(self, filepath):
self.handlers = {}

try:
self.module = import_module(filepath)
source = SourceFileLoader('middleware', self.filepath)
self.module = source.load_module()
self.register_handlers()
except:
tyk.log_error( "Middleware initialization error:" )
Expand Down

0 comments on commit cb47d36

Please sign in to comment.