Price Scheduled Tasks

Background jobs for cleaning up expired price data

The Price scheduled tasks handle cleanup of historical price data, removing expired prices and cost prices to maintain database performance and storage efficiency.

Available Tasks

TaskDescriptionType
Delete Expired PricesRemove product prices that have passed their expiration dateDelta
Delete Expired Cost PricesRemove product cost prices that have passed their expiration dateDelta

Overview

Price cleanup tasks help maintain system performance by removing historical price data:

  1. Sales Price Cleanup - Remove expired retail/sales prices
  2. Cost Price Cleanup - Remove expired supplier/cost prices

Common Use Cases

Historical Price Cleanup

Use Delete Expired Prices to remove old price records after promotional periods end, keeping the price index lean and queries fast.

Cost Price Maintenance

Enable Delete Expired Cost Prices to clean up historical supplier costs that are no longer relevant for inventory valuation.


Configuration Requirements

Both tasks require configuration of retention thresholds in tenant settings:

  • productSettings.deleteExpiredPricesThreshold - Days after expiration to keep prices
  • productSettings.deleteExpiredCostPricesThreshold - Days after expiration to keep cost prices

Task TypeRecommended ScheduleReason
Price cleanup0 3 * * 0 (weekly at 3 AM Sunday)Heavy operation, run off-peak
Cost price cleanup0 4 * * 0 (weekly at 4 AM Sunday)Heavy operation, run off-peak

On this page