Created
September 9, 2021 16:48
-
-
Save corypina/176de522d36ab19edd3d9117d2ede3f9 to your computer and use it in GitHub Desktop.
Ping WordPress cron to manage cron jobs externally. For use in AWS Lambda, etc.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const https = require("https"); | |
let url = "https://domain.com/wp-cron.php?doing_wp_cron"; | |
exports.handler = function (event, context, callback) { | |
https | |
.get(url, (res) => { | |
callback(null, res.statusCode); | |
}) | |
.on("error", (e) => { | |
callback(Error(e)); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment