channel-worker 2.5.80 → 2.5.81
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -189,8 +189,18 @@ async function readViewsPage(page, range, log) {
|
|
|
189
189
|
}).catch(() => '');
|
|
190
190
|
if (label && (!want || want.test(label))) break;
|
|
191
191
|
}
|
|
192
|
-
|
|
193
|
-
|
|
192
|
+
// Hai ca KHÁC HẲN nhau, đừng gộp:
|
|
193
|
+
// nhãn RỖNG = khoảng này chưa có số nào. Chuyện thường, không phải lỗi —
|
|
194
|
+
// lúc 0h sáng thì "Hôm nay" đương nhiên trống. Trả null, và
|
|
195
|
+
// vẫn đọc tiếp hai trang còn lại.
|
|
196
|
+
// nhãn KHÁC = trang đang hiện số của khoảng KHÁC. Đây mới là nguy hiểm:
|
|
197
|
+
// đọc tiếp là ghi số 28 ngày vào ô "hôm nay". Hỏng to.
|
|
198
|
+
if (label && want && !want.test(label)) {
|
|
199
|
+
throw new Error(`xin ${range} nhưng sau 24s trang vẫn hiện "${label}"`);
|
|
200
|
+
}
|
|
201
|
+
if (!label) {
|
|
202
|
+
log('info', `[insights] ${range}: trang chưa có số nào (khoảng này trống)`);
|
|
203
|
+
return { range, label: '', total: null, pct: null, posts: [] };
|
|
194
204
|
}
|
|
195
205
|
const raw = await page.evaluate(() => {
|
|
196
206
|
const clean = (v) => String(v || '').replace(/\s+/g, ' ').trim();
|