简体   繁体   中英

Periodically run a python program as a background service in firebase

Just start using the firebase + react to build a website. One of the designed features of my website is to crawl and show users the data parsed from another website (eg, the stock price changes). I already have a python crawler responsible to parse the data, but I have no idea how to execute this python crawler (in the background) of my server in firebase (or it is not even possible)?

Here is the example usage of my system

  1. user login and subscribe the website/data they are interesting
  2. my crawler will parse that website every 1 hour and update the data to database
  3. user can see the summary of change of website from database

One option I have in mind is running the crawler in my local machine and use the REST api to update the parsed data to firebase database. However, it seems a very inefficient/naive approach because it is kind of losing the meaning of deploying my server with cloud service, like firebase.

Firebase does not have any service/feature that allows you to periodically run Python or any other code. The closest thing to that is Cloud Functions, which can be triggered through an external service like cron-job.org.

For more in this, see:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM