Ideally, dbs_scrape should be able to determine if otphelper is online or not (maybe otphelper can detect network connectivity changes and save status to Firebase). This is so that dbs_scrape doesn't need to run unnecessarily, and be able to retry after N seconds/minutes.
Another way around this is to have the otphelper to report status every hour (like the hourly dbs_scrape). I think it is easier to implement it this way. dbs_scrape will only have to check if the last reported date is within an hour of current time or not.
Example: otphelper saves the date and time 201708051050, and dbs_scrape runs at 201708051100. As the two date and time are only 10 minutes apart (within an hour or 60 minutes), this passes the validation process. dbs_scrape can then judge that the otphelper is online albeit not accurate enough (if otphelper goes offline within that 10 minutes.
Ideally, dbs_scrape should be able to determine if otphelper is online or not (maybe otphelper can detect network connectivity changes and save status to Firebase). This is so that dbs_scrape doesn't need to run unnecessarily, and be able to retry after N seconds/minutes.
Another way around this is to have the otphelper to report status every hour (like the hourly dbs_scrape). I think it is easier to implement it this way. dbs_scrape will only have to check if the last reported date is within an hour of current time or not.
Example: otphelper saves the date and time 201708051050, and dbs_scrape runs at 201708051100. As the two date and time are only 10 minutes apart (within an hour or 60 minutes), this passes the validation process. dbs_scrape can then judge that the otphelper is online albeit not accurate enough (if otphelper goes offline within that 10 minutes.