Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new_bounty marketing emails need to be moved to a background job #477

Closed
owocki opened this issue Feb 22, 2018 · 20 comments
Closed

new_bounty marketing emails need to be moved to a background job #477

owocki opened this issue Feb 22, 2018 · 20 comments

Comments

@owocki
Copy link
Contributor

owocki commented Feb 22, 2018

related commit: dd9f45e

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
@gitcoinbot
Copy link
Member

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

@vs77bb
Copy link
Contributor

vs77bb commented Feb 27, 2018

@g33klord 👋 which route are you thinking on this one?

@g33klord
Copy link

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

@owocki
Copy link
Contributor Author

owocki commented Feb 27, 2018

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.

@mbeacom
Copy link
Contributor

mbeacom commented Mar 2, 2018

@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.

@g33klord
Copy link

g33klord commented Mar 5, 2018

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

@owocki
Copy link
Contributor Author

owocki commented Mar 19, 2018

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

@mbeacom
Copy link
Contributor

mbeacom commented Mar 20, 2018

@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!

@mbeacom
Copy link
Contributor

mbeacom commented Mar 21, 2018

@g33klord We'll be merging in Celery integration either today or tomorrow via: #668

@AlekKras
Copy link

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()

@vs77bb
Copy link
Contributor

vs77bb commented Apr 7, 2018

@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.

@mbeacom
Copy link
Contributor

mbeacom commented Apr 9, 2018

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

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

@gitcoinbot
Copy link
Member

@AlekKras are you still working on this issue?

@gitcoinbot
Copy link
Member

@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.

@gitcoinbot
Copy link
Member

gitcoinbot commented Apr 23, 2018

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.

@mkosowsk
Copy link

@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 😅

@owocki
Copy link
Contributor Author

owocki commented Apr 23, 2018

this was me testing.. whoops

@mkosowsk
Copy link

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

@mbeacom
Copy link
Contributor

mbeacom commented Apr 23, 2018

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

@gitcoinbot
Copy link
Member

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

@owocki owocki closed this as completed Apr 24, 2018
@gitcoinco gitcoinco deleted a comment May 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants