This commit is contained in:
NAME
2026-05-15 10:02:53 +00:00
parent 65768643e0
commit a00f220940
6 changed files with 316 additions and 5 deletions
+4 -1
View File
@@ -103,7 +103,10 @@ export class SqsPosterWorker {
// await postToX(data.content);
// giả lập delay
await this.sleep(rand(7, 10) * 1000); //nghỉ 10s
const sleepS = rand(12, 21) * 1000;
this.logger.log(`Nghỉ ${sleepS} second`);
await this.sleep(sleepS);
}
private sleep(ms: number) {
+4 -4
View File
@@ -358,7 +358,7 @@ export class XBrowserService implements OnModuleInit, OnModuleDestroy {
// await page.mouse.click(btnBox?.x + btnBox.width / 2, btnBox.y + btnBox.height / 2);
await page.keyboard.press('Control+Enter');
this.logger.debug('Nhấn Control+Enter done ...');
await page.waitForTimeout(5000);
await page.waitForTimeout(10000);
// Chờ request CreateTweet hoàn tất
// await page.waitForResponse(
@@ -484,7 +484,7 @@ export class XBrowserService implements OnModuleInit, OnModuleDestroy {
this.logger.debug('❌ Nut click khong duoc, thử dùng bàn phím Control+Enter');
await page.keyboard.press('Control+Enter');
});
await page.waitForTimeout(rand(4000, 6000));
await page.waitForTimeout(rand(6000, 10000));
this.logger.debug('✅ Quoted thành công');
} else {
@@ -581,8 +581,8 @@ export class XBrowserService implements OnModuleInit, OnModuleDestroy {
}
await btn.click();
this.logger.debug(`nhấn nút gửi ...`)
await page.waitForTimeout(3000);
this.logger.debug(`Đã nhấn nút gửi ...`)
await page.waitForTimeout(10000);
this.logger.debug('✅ Reply OK');
return {success: true, error: ''};