Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

The 4th edition of the Campaign Community Lens newsletter is out now!
SOLVED

Mirror page URL for multiple records.

Avatar

Level 3

Hi all,

I am trying to get the mirror page urls for a large number of records and update the same in a table for reporting purpose. I have tried nms.delivery.GetMirrorURL() and successfully got the urls in a table. But the problem is it takes a lot of time to get the work done (approx. 90 mins. for around 8000 records). Can anyone suggest a more time efficient way to get these urls into the table (using a workflow). Below is the code i tried.

Code:

var sql1=" SELECT ibId,idId FROM "+vars.tableName;

var sql2= sqlSelect("collection,bId:int,dId:int",sql1);

var mirror;

for each (var sql2 in sql2.collection){

 

     mirror = nms.delivery.GetMirrorURL(sql2.dId.toString(), sql2.bId.toString())

  

      sql = "UPDATE "+ vars.tableName +" SET sMirror='"+mirror+"' WHERE ibId="+sql2.bId.toString();

    

    logInfo(sqlExec(sql));

sqlExec(sql);

  }

This code is written in a javascript activity in a workflow.

Regards,

Jayesh Bhanushali

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi,

Measure which call is slow here by stubbing out the GetMirrorUrl() call and see how long it takes to run.

  • If sqlExec() is slow, check that ibId col is indexed in your table.
  • If GetMirrorUrl() is slow, replace it with your own js, it's just url-encoding cryptString('-1|<broadlog id in base16>|<delivery id in base16>').
  • Deleting the log-write line will also slightly improve perf.

Thanks,

-Jon

1 Reply

Avatar

Correct answer by
Community Advisor

Hi,

Measure which call is slow here by stubbing out the GetMirrorUrl() call and see how long it takes to run.

  • If sqlExec() is slow, check that ibId col is indexed in your table.
  • If GetMirrorUrl() is slow, replace it with your own js, it's just url-encoding cryptString('-1|<broadlog id in base16>|<delivery id in base16>').
  • Deleting the log-write line will also slightly improve perf.

Thanks,

-Jon