Force refresh calc fields


#1

I am trying to refresh calc fields on one specific id of BillingAccount on a remote env that has 21 million pending jobs in the CalcFieldsQueue. Is there a way to force that one job to the front of the queue, i.e. skip all other pending jobs?


#2

Checkout RefreshCalcFieldsSpec.

You can set async to be false, so it will be calculated synchronously.

Or you can set the priority to be higher than other jobs in the queue.


#3

You may want to look into CalcFieldsQueue.rescheduleByType(). It takes a % value as a threshold and moves all entries for a certain type into BatchQueue where they are computed much more efficiently.


#4

See the type FetchSpec.

BillingAccount.fetch({filter: Filter.eq("id", 'your_id'), refreshCalcFields: true, calcFieldsToRefresh: ['theFieldToRecalc']})


#5

Thanks guys. This command worked for me:

BillingAccount.refreshCalcFields({filter: Filter.eq("id", 'my_id'), async: false, calcFieldsToRefresh: ['theFieldToRecalc']})