Skip to content

Commit

Permalink
update hk_sfc
Browse files Browse the repository at this point in the history
  • Loading branch information
linxin committed Nov 8, 2024
1 parent 2c5c2fe commit c2d8bd9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/scheduled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ jobs:
SUPABASE_EMAIL: ${{ secrets.SUPABASE_EMAIL }}
run: |
bun install
bun run src/feishu/scheduled.ts
bun run hk_sfc
8 changes: 4 additions & 4 deletions src/feishu/scheduled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ async function getDiffIds(): Promise<[string[], string[]]> {
];
}

async function scheduled() {
export async function feishuScheduled() {
// get new ids
const [ids, ids2] = await getDiffIds();
if (ids2.length > 0) {
Expand All @@ -44,6 +44,6 @@ async function scheduled() {
}
}

(async () => {
await scheduled();
})();
// (async () => {
// await scheduled();
// })();
9 changes: 6 additions & 3 deletions src/sites/hk_sfc/entry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { insert, upsert } from "../../supabase/connect";
import { processInBatches } from "./fetch_detail";
import { insertDataToExcel } from "./feishu_excel";
import { main as feishuMain } from "../../feishu/sfc_company";
import { feishuScheduled } from "../../feishu/scheduled";
import {
getList,
getPreviousListCount,
Expand Down Expand Up @@ -41,8 +42,10 @@ export class HK_SFC {
console.log(
"🚀 ~ HK_SFC ~ check_list ~ previous_total_counts:",
previous_total_counts,
"「not_exist_ids」:",
not_exist_ids
// "「not_exist_ids」:",
// not_exist_ids,
"diff_ids:",
_diff_ids
);

// // 每次都记录当前请求到的数据情况
Expand Down Expand Up @@ -107,7 +110,7 @@ export class HK_SFC {
const ids = data_list.map((item) => item.ceref);
if (ids.length > 0) {
try {
await feishuMain(ids);
await feishuScheduled();
} catch (error) {
console.error("--> error syncing feishu", error);
}
Expand Down

0 comments on commit c2d8bd9

Please sign in to comment.