User guide
Quick Start Guide
Dashboard
Overviews
Case detail (Caseoverview)
Case - event
Tasks
Case notes
Documents
User settings
Favorites
Table component
FAQ
News/Announcements in Team assistant
Mobile app settings
Administrator Guide
Platform guide
Administration
Crons
Authentication and Synchronization
Mobile App Setup for Your Environment
Scheme
Dynamic tables
Archiving
Scripts
Service console
Scheduled Tasks
HR Agenda
Sequences
CSP Headers
Logs
Access Token Settings & Session Expiration
Template
Roles
Planning
Users
Organizational structure
Events
Translations
NFC Integration
AXIOS API
Calculations & Functions
Integrations
TAS Forms
TAS Forms
Activating the module on the environment
TAS Forms - secret creation guide for Docker Swarm
Advanced Features & Tips
Product
Technical Changelog
Business Changelog
Version Upgrade Guide
Upgrading to 5.9
Upgrading to 5.3
Dynamic conditions migration
PDF printing adjustment
Editing Task Description vs Task Instructions
Transpiling forEach to a for loop
Rendering HTML on Caseoverview
Upgrading to 5.7
Lodash upgrade v4.17.x (>v5.5)
Main changes and deprecated features (v5.3 > v5.7)
Highlighting variables in Read-only status (>v5.7.58)
Using validation functions
Differences between TAS4 and TAS5 - a complete overview
Best Practices for Upgrading from v4 to v5
Technical details
News / Important information
- All Categories /
- Administrator Guide
- Platform guide
- Administration
- Crons /
- Parallel cron - PostponedTaskCron
Parallel cron - PostponedTaskCron
PostponedTaskCron can run scheduled tasks since version 5.7.40. It is a so-called "Parallel cron" — a cron that can be cloned and run multiple times simultaneously, allowing a larger number of long-running tasks to be processed.
Parallel deployment setup
To use PostponedTaskCron for parallel processing of scheduled tasks, follow these steps:
- Disable the Cron cron
- Create as many PostponedTaskCron instances as you need and your server performance allows. It is recommended to start with 2 and increase gradually.
- Set each instance to run every 5 minutes (for example), offset by 1 minute from the previous one — so that instances do not trigger at the same time.
- Alternate the
startFromNewestparameter — set even instances totrue, odd instances tofalse(crons working against each other) - Set a low value for the
limitparameter on all instances (e.g.10)
PostponedTaskCron 1 – 10:01, every 5 min,
limit: 10, startFromNewest: falsePostponedTaskCron 2 – 10:02, every 5 min,
limit: 10, startFromNewest: truePostponedTaskCron 3 – 10:03, every 5 min,
limit: 10, startFromNewest: falsePostponedTaskCron 4 – 10:04, every 5 min,
limit: 10, startFromNewest: truelimit, run crons frequently, alternate the sort direction (startFromNewest), and ensure individual instances do not trigger at the same time.Configuration
The following parameters can be configured within the cron:
fromTime
Defines from what point in time the cron will pick up scheduled tasks. Accepts a string or a timestamp. Default is null (which means 1970). This setting is useful if, for some reason, an additional cron needs to start processing tasks only from a specific date. It acts as a safeguard for situations where one cron becomes overloaded and cannot start another.
lockTtl
The duration for which a task is locked — during this period, the task cannot be activated. For the cron to process and activate a scheduled task, it must successfully write a unique record to Redis. If it fails to acquire the lock, the task is skipped. This ensures that two or more crons do not attempt to activate the same task simultaneously. Locks are not explicitly released — they are left to expire naturally. The default value is 30 minutes (1800000 ms). A locked task can therefore only be activated again after this period has elapsed.
limit
Available since version 5.7.71. The maximum number of items processed in a single run. The limit is applied separately for Events and InstanceTasks. Type: number. Default: 1000.
startFromNewest
Available since version 5.7.71. Determines the sort order of tasks being processed. A value of true sorts from newest to oldest, false from oldest to newest. Type: boolean. Default: false.
Updated
by Frantisek Brych