Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

There is a dropdown in backoffice in Task, below the existing 'Redeem Promo Codes' called 'Schedule Redeem Promo'.  It uses the same format of upload file as the redeem promo codes task. 

The backoffice page for 'Schedule Redeem Promo' has a date and time field which the user must populate or the task will give a red error message in backoffice and not run.  This field gives a date and time after which this job will be scheduled to run. 

Reports for successfully creating the schedule will be under the Jobs tab in 'Schedule Redeem Promo'.  Once the scheduled time has passed reports for the actual promo voucher being applied will appear in the normal 'Redeem Promo Codes'  task Jobs tab, as if the user had uploaded them as they would have without using a scheduled task although the user that ran the task will be marked as 'system' as it is a system task that picks up the schedule and runs the promo task.

The way this process works is thus:
The User uploads a file of format

store,customer_number,code,replace_code


(this is the same format as for the non-scheduled version of this task) together with a time and date to apply this.


The uploaded file and time go into a temporary table called 

task_stg_redeem_promos_scheduled

this contains the uploaded information on each voucher to be applied to each customer from the upload file, together with the date and time to apply the voucher and a status showing initially that the job is scheduled.

A separate daemon triggered in rundeck polls this table.  Initially I've asked for this daemon to run every 15 minutes but this should be changeable in rundeck by request from Sysadmin/Infrastructure Team.

The Daemon finds tasks from the task_stg_redeem_promos_scheduled table that are in a scheduled state and whose run_after date has passed.  For these it runs a process which is basically identical to the process which is triggered by the  'Redeem Promo Codes' task in backoffice.



  • No labels