diff --git a/r2/r2/lib/db/thing.py b/r2/r2/lib/db/thing.py index 9247c53ae..b39b820c1 100644 --- a/r2/r2/lib/db/thing.py +++ b/r2/r2/lib/db/thing.py @@ -35,7 +35,7 @@ from .. utils import iters, Results, tup, to36, Storage, thing_utils, timefromno from r2.config import cache from r2.lib.cache import sgm from r2.lib.log import log_text -from r2.lib import stats +from r2.lib import stats, hooks from pylons import g @@ -297,7 +297,7 @@ class DataThing(object): if lock: lock.release() - g.plugins.on_thing_commit(self, to_set) + hooks.get_hook("thing.commit").call(thing=self, changes=to_set) @classmethod def _load_multi(cls, need): diff --git a/r2/r2/lib/plugin.py b/r2/r2/lib/plugin.py index 6a55cf5ab..db76e5f68 100644 --- a/r2/r2/lib/plugin.py +++ b/r2/r2/lib/plugin.py @@ -78,8 +78,6 @@ class Plugin(object): def load_controllers(self): pass - def on_thing_commit(self, thing, changes): - pass class PluginLoader(object): @@ -149,7 +147,3 @@ class PluginLoader(object): def load_controllers(self): for plugin in self: plugin.load_controllers() - - def on_thing_commit(self, thing, changes): - for plugin in self: - plugin.on_thing_commit(thing, changes)