Created
October 23, 2021 01:58
-
-
Save lucaspolo/239b2ce2804208530f24b63c6dfc994c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import time | |
from celery import Celery | |
app = Celery('tasks', broker=os.getenv('BROKER_URL', 'redis://localhost/0')) | |
@app.task | |
def envia_email(): | |
lista_de_usuarios = [ | |
'Monica', | |
'Cebolinha', | |
'Magali', | |
'Cascão', | |
'Louco', | |
'Tina', | |
'Rolo', | |
] | |
for usuario in lista_de_usuarios: | |
print(f'Enviando email para {usuario}...') | |
time.sleep(1) | |
print(f'Email enviando para {usuario}!') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment