Laravel and keeping my bitcoin bot running forever
I no longer write new content at tenghamn.com, you can find my new web related content at GoPHP.io and my personal blog posts at Ma.rkus.io.
My favorite domain registrar is NameSilo and if you use the affiliate link here it helps me earn some money from my writing: https://www.namesilo.com/pricing.php?rid=ee81e92mn, thanks! If you are new to NameSilo you can use my coupon, MARKUSTENGHAMN to save $1.00.
This post has been migrated and imported into different systems over the years, I have not had a chance to format this post manually so it may be hard to read but I have left it here as a reference.
So I was trying to figure out how to keep a script running forever as I want to constantly get social media updates and feeds from bitcoin exchanges when I use my bot to trade. Previously I would have done this with a bash script that would check for a tmp file that would be generated when the script was running and removed when it stopped, The script would be accessible as a console command in laraval making it easy to run. However, this could sometimes fail as well. I figured there must be a better way to achieve what I want to do.
I headed over to Reddit and posted my question where I have gotten a lot of help before and got a really useful answer from mbdjd. I had overlocked the cron section of the Laravel documentation that mentions the withoutOverlapping() method which would basically start my script whenever it stopped and keep it running at all times.