Skip to content

Commit

Permalink
Add threading for wordcloud creation
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonrhaas committed Feb 3, 2016
1 parent 2965a09 commit 7e5a97f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions slackcloud.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#! /usr/bin/env python

import os
import time
import logging
import threading

import matplotlib.pyplot as plt
from flask import Flask
Expand Down Expand Up @@ -51,7 +51,7 @@ def upload_wordcloud(channel_id, channel_name):
def parse_slash_cmd(**kwargs):
ch_id = kwargs.get('channel_id')
ch_name = kwargs.get('channel_name')
upload_wordcloud(ch_id, ch_name)
threading.Thread(target=upload_wordcloud, args=(ch_id, ch_name)).start()
return slack.response('Enjoy your wordcloud!')

if __name__ == "__main__":
Expand Down

0 comments on commit 7e5a97f

Please sign in to comment.