Fix Script in background: Progress worker state is not set to complete after worker is finished message

Community Alums
Not applicable

Has anyone received the error, Progress worker state is not set to complete after worker is finished, when running a Fix Script in the background?

I'm receiving this error and the state remains in Running but I know my script completes because of a log message I have at the end of the script displays in the Log.

 

9 REPLIES 9

Mohith Devatte
Tera Sage
Tera Sage

hello @Michael Coletti ,

What do you see in message field for your progress worker record ?Any error ? find_real_file.png@,

 

Community Alums
Not applicable

This is what I see:

find_real_file.png

 

your screenshot is broken can you attach it again?

 

Community Alums
Not applicable

Here is the Fix Script.  Nothing too complex.

 

var testTemplate = '197701c71b945550e5c7c9d6624bcb89';

try {
    var dmu = new DataMigrationUtil(testTemplate);
    // dmu.cleanUp();  
    dmu.configureConnection();

    
    var arrCustomerIDs = ['<TEST CUSTOMER ID>'];
    
    // For each customer listed, transfer its records
    for (var i = 0, len = arrCustomerIDs.length; i < len; i++ ) {

        var customerID = arrCustomerIDs[i];

        dmu.cleanUp();  // erase the Transferred IDs field for all Instance Data Table records
        dmu.startTransfer(customerID);  // loops through each active Instance Data Table record, passing in the testCustomerID

        gs.sleep(2000);
    }

    gs.log("[" + new Date().toISOString().slice(0, 23).replace("T", " ") + "] Migration complete", "data_migration");

    
} catch (e) {
    var prefix = "[" + new Date().toISOString().slice(0, 23).replace("T", " ") + "] ";
    
    gs.log(prefix + e, 'data_migration_error');
}