--- a/ForgeDiscussion/forgediscussion/tasks.py
+++ b/ForgeDiscussion/forgediscussion/tasks.py
@@ -1,12 +1,13 @@
import logging
from pylons import c
-
-from forgediscussion import model as DM
+from allura.lib.decorators import task
log = logging.getLogger(__name__)
+@task
def calc_forum_stats(shortname):
+ from forgediscussion import model as DM
forum = DM.Forum.query.get(
shortname=shortname, app_config_id=c.app.config._id)
if forum is None:
@@ -14,7 +15,9 @@
return
forum.update_stats()
+@task
def calc_thread_stats(thread_id):
+ from forgediscussion import model as DM
thread = DM.ForumThread.query.get(_id=thread_id)
if thread is None:
log.error("Error looking up thread: %r", thread_id)