-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fb212c0
commit cb79941
Showing
5 changed files
with
49 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import cron from "cron"; | ||
import https from "https"; | ||
|
||
const URL = process.env.CLOUD_BACKEND_URL; | ||
|
||
const job = new cron.CronJob("*/14 * * * *", function () { | ||
https | ||
.get(URL, (res) => { | ||
if (res.statusCode === 200) { | ||
console.log("GET request sent successfully"); | ||
} else { | ||
console.log("GET request failed", res.statusCode); | ||
} | ||
}) | ||
.on("error", (e) => { | ||
console.error("Error while sending request", e); | ||
}); | ||
}); | ||
|
||
export default job; |
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"siteId": "2f173ab2-a27f-47ab-931e-a07e183b7690" | ||
} |