Features: Improved handling of navigation errors and automatic updates, optimized wait times, and cron job configuration

This commit is contained in:
2025-11-05 21:03:48 +01:00
parent 4e8bd59ff4
commit 693246c2d5
6 changed files with 125 additions and 67 deletions

View File

@@ -213,6 +213,14 @@ export class Workers {
private async executeActivity(page: Page, activity: PromotionalItem | MorePromotion, selector: string, throttle: AdaptiveThrottler, retry: Retry): Promise<void> {
this.bot.log(this.bot.isMobile, 'ACTIVITY', `Found activity type: "${this.bot.activities.getTypeLabel(activity)}" title: "${activity.title}"`)
// Check if element exists before clicking (avoid 30s timeout)
try {
await page.waitForSelector(selector, { timeout: 5000 })
} catch (error) {
this.bot.log(this.bot.isMobile, 'ACTIVITY', `Activity selector not found (might be completed or unavailable): ${selector}`, 'warn')
return // Skip this activity gracefully instead of waiting 30s
}
await page.click(selector)
page = await this.bot.browser.utils.getLatestTab(page)