feat: complete day 7
This commit is contained in:
@@ -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 };
|
||||
|
||||
Reference in New Issue
Block a user