Exemplo n.º 1
0
 def message(cls, user, message, context, **kwargs):
     """A user sent a message"""
     q.enqueue(new_message_worker,
               args=(user, message, context),
               result_ttl=0)
Exemplo n.º 2
0
 def message(cls, user, message, context):
     """A user sent a message"""
     q.enqueue(foo, args=(user, message, context), result_ttl=0)
     pass
Exemplo n.º 3
0
        db.session.add(u)

        try:
            db.session.commit()
        except Exception, e:
            logging.warn(e)
            db.session.rollback()
            sentry_client.captureException()
        finally:
            CsUser.create(id=u.id, nick=u.nick, extended=dict(pic=u.pic_url))
        try:
            notification = u"Id:{} Nick:[{}] Name:[{}] Email:[{}] Followers:{}".format(
                u.id, user_login, name, email, github_user.get("followers", 0))

            worker_queue.enqueue(notify_registration,
                                 args=(notification, ),
                                 result_ttl=0)
        except Exception, ex:
            logging.exception(ex)
            sentry_client.captureException()

    return u

    # TODO: Create a task to fetch all the other information..

    # starred = user.get_starred()
    # for s in starred:
    #     print s.full_name, s.watchers

    # pub_events = user.get_public_events()
Exemplo n.º 4
0
 def message(cls, user, message, context):
     """A user sent a message"""
     q.enqueue(foo, args=(user, message, context), result_ttl=0)
     pass