From 633435a2fe9012d0281a4f3a3b158de61de7e3f0 Mon Sep 17 00:00:00 2001 From: Dominik Picheta Date: Sun, 23 Aug 2015 22:38:57 +0100 Subject: [PATCH] Added asyncCheck to discarded future and moved out of template. --- forum.nim | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/forum.nim b/forum.nim index fbb0011..c5c8f13 100644 --- a/forum.nim +++ b/forum.nim @@ -491,10 +491,6 @@ template writeToDb(c, cr, setPostId: expr) = if setPostId: c.postId = retID.int -template sendToMailingList(c) = - # send comment to a mailing list (if configured to do so) - discard sendMailToMailingList(c.config, c.username, c.email, subject, content) - proc edit(c: var TForumData, postId: int): bool = checkLogin(c) if c.isPreview: @@ -545,7 +541,8 @@ proc reply(c: var TForumData): bool = exec(db, sql"update thread set modified = DATETIME('now') where id = ?", $c.threadId) - sendToMailingList(c) + asyncCheck sendMailToMailingList(c.config, c.username, c.email, + subject, content) result = true proc newThread(c: var TForumData): bool = @@ -564,7 +561,8 @@ proc newThread(c: var TForumData): bool = writeToDb(c, crCreate, false) discard tryExec(db, sql"insert into post_fts(post_fts) values('optimize')") discard tryExec(db, sql"insert into post_fts(thread_fts) values('optimize')") - sendToMailingList(c) + asyncCheck sendMailToMailingList(c.config, c.username, c.email, + subject, content) result = true proc login(c: var TForumData, name, pass: string): bool =