Click here to Skip to main content
15,895,709 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm making this project WaterPi: Houseplant Remote Watering and Monitoring System - Hackster.io[^] and need help running this line of code periodically
CLIENT.publish('pump/data', {state:{pump: params['action']}}.to_json)

and in the comments the creator says to just add the right parameters to make it run periodically. I'd like to run it every 2 days but not sure how do that.

What I have tried:

every(2.day, :at => '08:00') do
  CLIENT.publish('pump/data', {state:{pump: params['action']}}.to_json)
  200
end
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900