Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 🐛 add console log in cron job #87

Merged
merged 1 commit into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/allBusRoute/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,16 @@ export const allBusRoute: Handler = async (event: APIGatewayEvent, context: Cont
};

async function deleteAllBusRoute() {
console.log('### deleteAllBusRoute start ###');

const singaporeBusRoute = await SingaporeBusRoute.scan().all().exec();
const singaporeBusRouteList = singaporeBusRoute.toJSON();
for (let index = 0; index < singaporeBusRouteList.length; index++) {
const singaporeBusRoute = singaporeBusRouteList[index];
await SingaporeBusRoute.delete({ id: singaporeBusRoute.id });
}

console.log('### deleteAllBusRoute end ###');
}

async function fetchBusRoute(skipNum?: number) {
Expand Down
4 changes: 4 additions & 0 deletions src/allBusService/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,16 @@ export const allBusService: Handler = async (event: APIGatewayEvent, context: Co
};

async function deleteAllBusService() {
console.log('### deleteAllBusService start ###');

const singaporeBusService = await SingaporeBusService.scan().all().exec();
const singaporeBusServiceList = singaporeBusService.toJSON();
for (let index = 0; index < singaporeBusServiceList.length; index++) {
const singaporeBusService = singaporeBusServiceList[index];
await SingaporeBusService.delete({ id: singaporeBusService.id });
}

console.log('### deleteAllBusService end ###');
}

async function fetchBusService(skipNum?: number) {
Expand Down
4 changes: 4 additions & 0 deletions src/allBusStop/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,16 @@ export const allBusStop: Handler = async (event: APIGatewayEvent, context: Conte
};

async function deleteAllBusStop() {
console.log('### deleteAllBusStop start ###');

const singaporeBusStop = await SingaporeBusStop.scan().all().exec();
const singaporeBusStopList = singaporeBusStop.toJSON();
for (let index = 0; index < singaporeBusStopList.length; index++) {
const singaporeBusStop = singaporeBusStopList[index];
await SingaporeBusStop.delete({ id: singaporeBusStop.id });
}

console.log('### deleteAllBusStop end ###');
}

async function fetchBusStop(skipNum?: number) {
Expand Down
Loading