feat: complete day 7

This commit is contained in:
Ayobami
2025-07-15 16:18:19 +01:00
parent f87c93e85c
commit 10447cd05e
7 changed files with 283 additions and 55 deletions
+8 -4
View File
@@ -24,6 +24,8 @@ async function fetchShopifyCustomers() {
const curlCommand = `curl -i -X GET "${nextUrl}"`;
const { stdout } = await execPromise(curlCommand);
console.log(stdout);
// Separate headers and body
const parts = stdout.split("\r\n\r\n");
const rawHeaders = parts[0];
@@ -70,11 +72,13 @@ async function syncCustomers() {
}
}
syncCustomers();
// run every minute
cron.schedule("* * * * *", () => {
console.log("Running Shopify customer sync...");
syncCustomers();
});
// cron.schedule("* * * * *", () => {
// console.log("Running Shopify customer sync...");
// syncCustomers();
// });
// For manual testing
module.exports = { syncCustomers };