Web: new_bounty marketing emails need to be moved to a background job

Created on 22 Feb 2018  路  20Comments  路  Source: gitcoinco/web

related commit: dd9f45ed1d4866caea6eef46a0e1051369c991ae

the new_bounty functionality doesnt scale because there are typically a bunch of matches generated in this loop => https://github.com/gitcoinco/web/blob/master/app/dashboard/notifications.py#L416-L427

please move this code into a background job. two ways we could go:

  1. invest in a true event driven procescesing system (like celery, or a log based microservices architeture)
  2. just do it in a management command

Most helpful comment

@mbeacom I understand. I am proceeding in direction to provision celery worker as a docker image.

All 20 comments

__This issue now has a funding of 0.03 ETH (25.67 USD) attached to it.__

  • If you would like to work on this issue you can claim it here.
  • If you've completed this issue and want to claim the bounty you can do so here
  • Questions? Get help on the Gitcoin Slack
  • $10202.54 more Funded OSS Work Available at: https://gitcoin.co/explorer

@g33klord 馃憢 which route are you thinking on this one?

@vs77bb Hi! I am planning to do it using celery. Setting up celery will be beneficial for other part of projects too.

neat-o. @g33klord id love to see some basic celery setup instructions included with your submission so we can implement in production the same way you did.

@g33klord Thanks for starting on this. If you need any assistance setting up Celery, please let me know. If possible, I'd like to limit our need for self-hosted services as much as possible (making use of managed services like SQS or elasticache-based Redis would be ideal for the broker), but I'm not opposed to self-hosted Rabbitmq... however, I'm trying to avoid adding more hosted solutions when possible. Ideally, the celery worker would be provisioned as a docker image for local development and live implementation.

@mbeacom I understand. I am proceeding in direction to provision celery worker as a docker image.

@g33klord are you still working on this? im happy to throw a little more ETH in since the market has been upser bear recently

@g33klord If not, no sweat!

If it's simpler, maybe we could implement Celery first on our end first. Feel free to let us know what works best for you!

@g33klord We'll be merging in Celery integration either today or tomorrow via: https://github.com/gitcoinco/web/pull/668

I am new to this issue, so I might be extremely wrong but could that be a solution?

from celery import Celery

app = Celery(
    # XXX The below 'myapp' is the name of this module, for generating
    # task names when executed as __main__.
    'myapp',
    broker='amqp://guest@localhost//',
    # ## add result backend here if needed.
    # backend='rpc'
)

app.conf.timezone = 'UTC'


@app.task
def maybe_market_tip_to_github(tip):
     tip = dashboard.models.Tip
     if (not settings.GITHUB_CLIENT_ID) or ( not tip.github_url) or (not settings.GITHUB_CLIENT_COMMENT):
         return False


@app.on_after_configure.connect
def setup_periodic_tasks(sender, **kwargs):

    sender.add_periodic_task(10.0, maybe_market_tip_to_github(tip))

if __name__ == '__main__':
    app.start()

@mbeacom I think question is in your court here...

@AlekKras Would you mind claiming work on Gitcoin here by clicking 'Start Work'? Probably removed on our end due to inactivity, apologies.

@vs77bb @AlekKras This is already implemented and tracked at #668

This issue will be a followup after the above is merged.

@AlekKras are you still working on this issue?

@AlekKras has been removed from this issue due to inactivity (12 days) on the github thread. @AlekKras if you believe this was done in error, please go to the bounty and click 'start work' again.

__Work has been started on the 0.03 ETH (19.19 USD @ $639.52/ETH) funding by__:

  1. @gitcoinbot

__Please work together__ and coordinate delivery of the issue scope. Gitcoin doesn't know enough about everyones skillsets / free time to say who should work on what, but we trust that the community is smart and well-intentioned enough to work together. As a general rule; if you start work first, youll be at the top of the above list ^^, and should have 'dibs' as long as you follow through.

On the above list? Please leave a comment to let the funder (@owocki) and the other parties involved what you're working, with respect to this issue and your plans to resolve it. If you don't leave a comment, the funder may expire your submission at their discretion.

@gitcoinbot finally getting in the game and programming! @mbeacom might want to take a look at this one :)

Also can't help but notice that @gitcoinbot is confused by programming... I can relate 馃槄

this was me testing.. whoops

@owocki good to hear, means the bots haven't become sentient... yet 馃槼馃槼馃槼

That won't be a problem until we onboard Eklow Labs.

__The funding of 0.03 ETH (19.19 USD @ $639.52/ETH) attached to this issue has been killed by the bounty submitter__

Was this page helpful?
0 / 5 - 0 ratings

Related issues

abitrolly picture abitrolly  路  4Comments

mbeacom picture mbeacom  路  4Comments

sethmcleod picture sethmcleod  路  4Comments

IgorPerikov picture IgorPerikov  路  3Comments

kziemianek picture kziemianek  路  3Comments