Looking for a Wappler solution before i submit a feature request, basically looking at something like manipulating the Server Connect "Enable Scheduler" option programmatically.
The Problem
I have a batch job i want to leave running while on holiday (23 days) , running by means of a server connect schedule.
I am using Opencage to geolocate about 35K addresses.
Opencage limits the free tier to 2.5k calls per day
Hence i intend to leave a scheduled task running every 45 seconds (approx 17 days to competion).
The task makes a database query to a file containing addresses and gets an address that has no lat/lng coordinates, calls Opencage (custom extension, will publish after testing) and saves the response.
That's pretty simple
However, in an ideal world (and probably for me, the fun of a technical challenge) i would like to scheduler to stop when all records are geocoded, can this be done within Wappler, is there a scheduler deactivate function/ methodology.
Currently i have put a workaround in place (untested) by setting an ENV variable GEOCODE_ACTIVE with value 1
In the scheduler i check that value and if not 1, the scheduler does nothing otherwise it proceeds.
If no record found i use this extension to manipulate the value of the ENV setting to 0
https://www.npmjs.com/package/@hyperbytes/wappler-get-or-set-environment-value
Which wont stop the scheduler running but at least reduces the server load to a minimum.
Anyone any better solutions. (No untested AI suggestions please, been down a few rabbit holes with that method.)