I have an agent called from the web, it processes 4 documents in a loop and then prints some HTML back to the browser. The execution of the agent is within 1 second, but after the HTML is printed, it takes another 27 seconds before the agent returns control and actually refreshes the browser.
The timestamps at the end of each line in the agent log below is printed by me from a NotesDateTiem object which is “SetNow” before each printout. Just to verify the times the agent log prints by itself at the beginning of each line.
Look at the last two lines and timestamps… What happens between 10:32:03 and 10:32:30 which is actually when the browser refreshes? Weird!
AGENT LOG
Started running agent ‘Act2’ on 2005-03-31 10:32:02
2005-03-31 10:32:02: Act 2 started: 10:32:03
2005-03-31 10:32:03: Before Select Case: 10:32:03
2005-03-31 10:32:03: Case IO recognized: 10:32:03
2005-03-31 10:32:03: Entered SetInfoOwner sub: 10:32:03
2005-03-31 10:32:03: Before loop: 10:32:03
2005-03-31 10:32:03: 1: 10:32:03
2005-03-31 10:32:03: 2: 10:32:03
2005-03-31 10:32:03: 3: 10:32:03
2005-03-31 10:32:03: 4: 10:32:03
2005-03-31 10:32:03: After Loop, before stamp: 10:32:03
2005-03-31 10:32:03: After stamp: 10:32:03
2005-03-31 10:32:03: After Select Case + Action 10:32:03
2005-03-31 10:32:03: Before URL open: 10:32:03
2005-03-31 10:32:03: URL sent to browser: 10:32:03
Ran LotusScript code
Done running agent ‘Act2’ on 2005-03-31 10:32:30
The code representing the last lines in the Agent Log:
Call Notesdt.SetNow()
Call agentLog.logAction("Before URL open: "+ Notesdt.TimeOnly) ' <- Add line to log
If Skiplist = "" Then
Print (|<script>top.opener.location.href="| & ReturnURL & |&| & UrlTag & |";self.close();</script>|)
Else
Print (|<script>alert('| & SkipList & |');top.opener.location.href="| & ReturnURL & |&| & UrlTag & |";self.close();</script>|)
End If
Call Notesdt.SetNow()
Call agentLog.logAction("URL sent to browser: "+ Notesdt.TimeOnly) ' <- Add line to log
Exit Sub