You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
after adding apsceduler and running the flask code in the terminal using $flask run, the website link wont appear like usual but after removing the apscheduler code the link is sent and i can run my code. Does anyone know how to fix this?
@login_requireddefsend_mail():
withapp.app_context():
user=db.execute("SELECT email FROM user WHERE id = 28")
email= []
foriinrange(len(user)):
email.append(user[i]["email"])
user_email= (" ".join(email))
msg=Message('Medication Tracker', sender="ifeoduyemiwas@gmail.com", recipients=[user_email])
msg.body="Remember your event today"mail.send(msg)
conn=sqlite3.connect('finance.db')
cursor=conn.cursor()
time_event=cursor.execute("SELECT events_time FROM events WHERE user_id = 28")
rows=cursor.fetchall()
scheduler=BackgroundScheduler(daemon=True)
whileTrue:
forrowinrows:
events_time_str=row[0]
events_time=datetime.strptime(events_time_str, "%Y-%m-%dT%H:%M")
scheduler.add_job(send_mail, 'date', run_date=events_time)
scheduler.start()
time.sleep(60)
conn.close() ```
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
after adding apsceduler and running the flask code in the terminal using $flask run, the website link wont appear like usual but after removing the apscheduler code the link is sent and i can run my code. Does anyone know how to fix this?
Beta Was this translation helpful? Give feedback.
All reactions