Skip to content

Instantly share code, notes, and snippets.

@nfarah86
Created May 18, 2020 06:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nfarah86/959d875ad5ffcc08e16e3bf25358385a to your computer and use it in GitHub Desktop.
Save nfarah86/959d875ad5ffcc08e16e3bf25358385a to your computer and use it in GitHub Desktop.
Create a scheduler
@tl.job(interval=timedelta(seconds=120))
def sample_job_every_120s():
weather_response = get_weather_data()
air_pollution_data = get_air_pollution_data()
insert_to_mongo(weather_response, air_pollution_data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment