Ideas needed for why script is taking so long

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Ideas needed for why script is taking so long

Keith M. Rettig
I have a script that checks for records (status=0) that need to be sent out via email.
If I run the script on my desktop (server hosted db) in FMAdv15, it takes the expected 4 seconds to run and runs perfectly.
If it runs on the server under a scheduled script, it takes 104+ seconds to run.
What the heck?

So I did the right thing and added a “set variable” step and recorded the Get (CurrentTimestamp) after every step.
Well it takes the script 100 seconds to do the very first step.  The script is not even starting (despite the admin console indicating that it has started.


I have copy and pasted all of the steps into a new script and called that in the Scheduled Script instead.
I have created a new Scheduled Script.
I changed the name of the layout.  Not sure why but I am reaching for straws now.
I removed the “Capture Errors” step (my first step in nearly every script).  Not sure why but I am reaching for straws still.
All to no avail?

Oh, and get this; once it spends the 100 seconds to even start, it completely ignores the found records and fails to perform the script steps inside the IF( get (found count) > 0 ) section of the script.  Even though it reports in my logging that it is aware of the three found records.

Any ideas?  Any suggestions of where to look?

Thanks in advance,
Keith.
_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Ideas needed for why script is taking so long

James Ramsey
Did you record the time stamp *before* the first step of the script?  How long did it take FMS to get to the point where it even started running your script?

My recollection is that FMS, when running scheduled scripts, still has to “open” the databases, and on open scripts can run…  Don’t quote me on that.  Just my recollection.


--
Workflow Data Systems, LLC
[hidden email]
(614) 352-5795 (cell)



> On May 8, 2017, at 7:39 PM, Keith M. Rettig <[hidden email]> wrote:
>
> I have a script that checks for records (status=0) that need to be sent out via email.
> If I run the script on my desktop (server hosted db) in FMAdv15, it takes the expected 4 seconds to run and runs perfectly.
> If it runs on the server under a scheduled script, it takes 104+ seconds to run.
> What the heck?
>
> So I did the right thing and added a “set variable” step and recorded the Get (CurrentTimestamp) after every step.
> Well it takes the script 100 seconds to do the very first step.  The script is not even starting (despite the admin console indicating that it has started.
>
>
> I have copy and pasted all of the steps into a new script and called that in the Scheduled Script instead.
> I have created a new Scheduled Script.
> I changed the name of the layout.  Not sure why but I am reaching for straws now.
> I removed the “Capture Errors” step (my first step in nearly every script).  Not sure why but I am reaching for straws still.
> All to no avail?
>
> Oh, and get this; once it spends the 100 seconds to even start, it completely ignores the found records and fails to perform the script steps inside the IF( get (found count) > 0 ) section of the script.  Even though it reports in my logging that it is aware of the three found records.
>
> Any ideas?  Any suggestions of where to look?
>
> Thanks in advance,
> Keith.
> _______________________________________________
> FMPexperts mailing list
> [hidden email]
> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Ideas needed for why script is taking so long

Stephen Wonfor-3
In reply to this post by Keith M. Rettig
Keith

Are you operating on a “maintenance” layout.  No fields anywhere.  A straw to be sure but a straw nonetheless.

Stephen

---

"Outside in the street, the first lights had come on and the slithy toves were doing whatever they do in the wabe. Some days they gyre, some days they gimble. It’s no skin off my nose, but I wish they’d make their minds up, then we could all rest easy."  ~Miles Kington

> On May 8, 2017, at 5:39 PM, Keith M. Rettig <[hidden email]> wrote:
>
> I have a script that checks for records (status=0) that need to be sent out via email.
> If I run the script on my desktop (server hosted db) in FMAdv15, it takes the expected 4 seconds to run and runs perfectly.
> If it runs on the server under a scheduled script, it takes 104+ seconds to run.
> What the heck?
>
> So I did the right thing and added a “set variable” step and recorded the Get (CurrentTimestamp) after every step.
> Well it takes the script 100 seconds to do the very first step.  The script is not even starting (despite the admin console indicating that it has started.
>
>
> I have copy and pasted all of the steps into a new script and called that in the Scheduled Script instead.
> I have created a new Scheduled Script.
> I changed the name of the layout.  Not sure why but I am reaching for straws now.
> I removed the “Capture Errors” step (my first step in nearly every script).  Not sure why but I am reaching for straws still.
> All to no avail?
>
> Oh, and get this; once it spends the 100 seconds to even start, it completely ignores the found records and fails to perform the script steps inside the IF( get (found count) > 0 ) section of the script.  Even though it reports in my logging that it is aware of the three found records.
>
> Any ideas?  Any suggestions of where to look?
>
> Thanks in advance,
> Keith.
> _______________________________________________
> FMPexperts mailing list
> [hidden email]
> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Ideas needed for why script is taking so long

GordonCox
In reply to this post by Keith M. Rettig
Keith,

Do you have an onFirstWindowOpen script trigger?

If you onFirstWindowOpen takes a while that could be a cause which you wouldn’t see as you already have the file open when running the script locally?


Regards,

   Gordon


> On 9 May 2017, at 7:39 am, Keith M. Rettig <[hidden email]> wrote:
>
> I have a script that checks for records (status=0) that need to be sent out via email.
> If I run the script on my desktop (server hosted db) in FMAdv15, it takes the expected 4 seconds to run and runs perfectly.
> If it runs on the server under a scheduled script, it takes 104+ seconds to run.
> What the heck?
>
> So I did the right thing and added a “set variable” step and recorded the Get (CurrentTimestamp) after every step.
> Well it takes the script 100 seconds to do the very first step.  The script is not even starting (despite the admin console indicating that it has started.
>
>
> I have copy and pasted all of the steps into a new script and called that in the Scheduled Script instead.
> I have created a new Scheduled Script.
> I changed the name of the layout.  Not sure why but I am reaching for straws now.
> I removed the “Capture Errors” step (my first step in nearly every script).  Not sure why but I am reaching for straws still.
> All to no avail?
>
> Oh, and get this; once it spends the 100 seconds to even start, it completely ignores the found records and fails to perform the script steps inside the IF( get (found count) > 0 ) section of the script.  Even though it reports in my logging that it is aware of the three found records.
>
> Any ideas?  Any suggestions of where to look?
>
> Thanks in advance,
> Keith.
> _______________________________________________
> FMPexperts mailing list
> [hidden email]
> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Ideas needed for why script is taking so long

Joel Stoner
Remember that PSoS has no context until you give it some. Make sure you
tell it what file / layout, etc it should be on at the beginning of the
script, and that the account you're using to run the script has access to
everything it needs. Also be aware of ScriptTriggers as Gordon said...

On Mon, May 8, 2017 at 4:55 PM, Gordon Cox <[hidden email]> wrote:

> Keith,
>
> Do you have an onFirstWindowOpen script trigger?
>
> If you onFirstWindowOpen takes a while that could be a cause which you
> wouldn’t see as you already have the file open when running the script
> locally?
>
>
> Regards,
>
>    Gordon
>
>
> > On 9 May 2017, at 7:39 am, Keith M. Rettig <[hidden email]>
> wrote:
> >
> > I have a script that checks for records (status=0) that need to be sent
> out via email.
> > If I run the script on my desktop (server hosted db) in FMAdv15, it
> takes the expected 4 seconds to run and runs perfectly.
> > If it runs on the server under a scheduled script, it takes 104+ seconds
> to run.
> > What the heck?
> >
> > So I did the right thing and added a “set variable” step and recorded
> the Get (CurrentTimestamp) after every step.
> > Well it takes the script 100 seconds to do the very first step.  The
> script is not even starting (despite the admin console indicating that it
> has started.
> >
> >
> > I have copy and pasted all of the steps into a new script and called
> that in the Scheduled Script instead.
> > I have created a new Scheduled Script.
> > I changed the name of the layout.  Not sure why but I am reaching for
> straws now.
> > I removed the “Capture Errors” step (my first step in nearly every
> script).  Not sure why but I am reaching for straws still.
> > All to no avail?
> >
> > Oh, and get this; once it spends the 100 seconds to even start, it
> completely ignores the found records and fails to perform the script steps
> inside the IF( get (found count) > 0 ) section of the script.  Even though
> it reports in my logging that it is aware of the three found records.
> >
> > Any ideas?  Any suggestions of where to look?
> >
> > Thanks in advance,
> > Keith.
> > _______________________________________________
> > FMPexperts mailing list
> > [hidden email]
> > http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
>
> _______________________________________________
> FMPexperts mailing list
> [hidden email]
> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
>



--


*Joel Stoner*
*FounderAlterMedia, Inc. *(Studio Suite)

800.450.5740  ext. 101  (US and Canada)
818.955.9550  ext. 101  (Los Angeles)

[hidden email]://www.studiosuite.net


Think strategically.
Improve your bottom line.
Grow revenue & increase efficiency.


  <http://www.twitter.com/studio_suite>
<http://www.facebook.com/studiosuite>
<http://www.linkedin.com/company/altermedia-inc->
<https://plus.google.com/+AltermediaUS>
<http://www.instagram.com/altermedia>
<http://www.pinterest.com/studiosuite>
<http://www.youtube.com/altermediainc>
_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Ideas needed for why script is taking so long

JClose
In reply to this post by GordonCox
Keith,
    As others have mentioned, when you run a file as a scheduled script, it does open the file and go through the same processes as if any other user had opened it - i.e. it runs whatever startup script you have defined.

But, it sounds like the file is timing out on trying to open an External Data Source.  What user is it logging in with for these scheduled scripts?  Does that user exist on the external files you have defined in this database?

--  Justin


----- Original Message -----From: Gordon Cox <[hidden email]>To: fmexperts <[hidden email]>Sent: Mon, 08 May 2017 23:55:09 -0000 (UTC)Subject: Re: Ideas needed for why script is taking so long

Keith,

Do you have an onFirstWindowOpen script trigger?

If you onFirstWindowOpen takes a while that could be a cause which you wouldn&rsquo;t see as you already have the file open when running the script locally?

Regards,

Gordon

> On 9 May 2017, at 7:39 am, Keith M. Rettig <[hidden email]> wrote:> > I have a script that checks for records (status=0) that need to be sent out via email.> If I run the script on my desktop (server hosted db) in FMAdv15, it takes the expected 4 seconds to run and runs perfectly.> If it runs on the server under a scheduled script, it takes 104+ seconds to run.> What the heck?> > So I did the right thing and added a &ldquo;set variable&rdquo; step and recorded the Get (CurrentTimestamp) after every step.> Well it takes the script 100 seconds to do the very first step. The script is not even starting (despite the admin console indicating that it has started.> > > I have copy and pasted all of the steps into a new script and called that in the Scheduled Script instead.> I have created a new Scheduled Script.> I changed the name of the layout. Not sure why but I am reaching for straws now.> I removed the &ldquo;Capture Errors&rdquo; step (my first step in nearly every
 script). Not sure why but I am reaching for straws still.> All to no avail?> > Oh, and get this; once it spends the 100 seconds to even start, it completely ignores the found records and fails to perform the script steps inside the IF( get (found count) > 0 ) section of the script. Even though it reports in my logging that it is aware of the three found records.> > Any ideas? Any suggestions of where to look?> > Thanks in advance,> Keith.
_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Ideas needed for why script is taking so long

James Ramsey
And now that you mention it, I believe externally referenced databases have to be in the same folder as the root opened file, or they'll fail to open... even with valid access privileges.

> On May 8, 2017, at 9:03 PM, [hidden email] wrote:
>
> Keith,
>    As others have mentioned, when you run a file as a scheduled script, it does open the file and go through the same processes as if any other user had opened it - i.e. it runs whatever startup script you have defined.
>
> But, it sounds like the file is timing out on trying to open an External Data Source.  What user is it logging in with for these scheduled scripts?  Does that user exist on the external files you have defined in this database?
>
> --  Justin
>
>
> ----- Original Message -----From: Gordon Cox <[hidden email]>To: fmexperts <[hidden email]>Sent: Mon, 08 May 2017 23:55:09 -0000 (UTC)Subject: Re: Ideas needed for why script is taking so long
>
> Keith,
>
> Do you have an onFirstWindowOpen script trigger?
>
> If you onFirstWindowOpen takes a while that could be a cause which you wouldn&rsquo;t see as you already have the file open when running the script locally?
>
> Regards,
>
> Gordon
>
>> On 9 May 2017, at 7:39 am, Keith M. Rettig <[hidden email]> wrote:> > I have a script that checks for records (status=0) that need to be sent out via email.> If I run the script on my desktop (server hosted db) in FMAdv15, it takes the expected 4 seconds to run and runs perfectly.> If it runs on the server under a scheduled script, it takes 104+ seconds to run.> What the heck?> > So I did the right thing and added a &ldquo;set variable&rdquo; step and recorded the Get (CurrentTimestamp) after every step.> Well it takes the script 100 seconds to do the very first step. The script is not even starting (despite the admin console indicating that it has started.> > > I have copy and pasted all of the steps into a new script and called that in the Scheduled Script instead.> I have created a new Scheduled Script.> I changed the name of the layout. Not sure why but I am reaching for straws now.> I removed the &ldquo;Capture Errors&rdquo; step (my first step in nearly every
 
> script). Not sure why but I am reaching for straws still.> All to no avail?> > Oh, and get this; once it spends the 100 seconds to even start, it completely ignores the found records and fails to perform the script steps inside the IF( get (found count) > 0 ) section of the script. Even though it reports in my logging that it is aware of the three found records.> > Any ideas? Any suggestions of where to look?> > Thanks in advance,> Keith.
> _______________________________________________
> FMPexperts mailing list
> [hidden email]
> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Ideas needed for why script is taking so long

tim ballering-2
In reply to this post by Keith M. Rettig
Are you on the proper layout and TO?

My guess, because I’ve made this mistake this before, is you’ve take a client script that was called by a button on the correct layout and ported to Server without adding a go to layout step.

Tim Ballering
[hidden email]



> On May 8, 2017, at 7:39 PM, Keith M. Rettig <[hidden email]> wrote:
>
> I have a script that checks for records (status=0) that need to be sent out via email.
> If I run the script on my desktop (server hosted db) in FMAdv15, it takes the expected 4 seconds to run and runs perfectly.
> If it runs on the server under a scheduled script, it takes 104+ seconds to run.
> What the heck?
>
> So I did the right thing and added a “set variable” step and recorded the Get (CurrentTimestamp) after every step.
> Well it takes the script 100 seconds to do the very first step.  The script is not even starting (despite the admin console indicating that it has started.
>
>
> I have copy and pasted all of the steps into a new script and called that in the Scheduled Script instead.
> I have created a new Scheduled Script.
> I changed the name of the layout.  Not sure why but I am reaching for straws now.
> I removed the “Capture Errors” step (my first step in nearly every script).  Not sure why but I am reaching for straws still.
> All to no avail?
>
> Oh, and get this; once it spends the 100 seconds to even start, it completely ignores the found records and fails to perform the script steps inside the IF( get (found count) > 0 ) section of the script.  Even though it reports in my logging that it is aware of the three found records.
>
> Any ideas?  Any suggestions of where to look?
>
> Thanks in advance,
> Keith.
> _______________________________________________
> FMPexperts mailing list
> [hidden email]
> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Ideas needed for why script is taking so long

Stephen Wonfor-3
Keith

Along this line you might do the FirstWndowOpen to a neutral maintenance layout in the table you wish to operate in.  I seem to recall some lines of thought that entering FIND mode first can prevent excessive data loading.

Stephen

---

"It's not difficult to tell crocodiles and alligators apart. One will see you in a while whereas the other will see you later."

> On May 8, 2017, at 7:34 PM, Tim Ballering <[hidden email]> wrote:
>
> Are you on the proper layout and TO?
>
> My guess, because I’ve made this mistake this before, is you’ve take a client script that was called by a button on the correct layout and ported to Server without adding a go to layout step.
>
> Tim Ballering
> [hidden email]
>
>
>
>> On May 8, 2017, at 7:39 PM, Keith M. Rettig <[hidden email]> wrote:
>>
>> I have a script that checks for records (status=0) that need to be sent out via email.
>> If I run the script on my desktop (server hosted db) in FMAdv15, it takes the expected 4 seconds to run and runs perfectly.
>> If it runs on the server under a scheduled script, it takes 104+ seconds to run.
>> What the heck?
>>
>> So I did the right thing and added a “set variable” step and recorded the Get (CurrentTimestamp) after every step.
>> Well it takes the script 100 seconds to do the very first step.  The script is not even starting (despite the admin console indicating that it has started.
>>
>>
>> I have copy and pasted all of the steps into a new script and called that in the Scheduled Script instead.
>> I have created a new Scheduled Script.
>> I changed the name of the layout.  Not sure why but I am reaching for straws now.
>> I removed the “Capture Errors” step (my first step in nearly every script).  Not sure why but I am reaching for straws still.
>> All to no avail?
>>
>> Oh, and get this; once it spends the 100 seconds to even start, it completely ignores the found records and fails to perform the script steps inside the IF( get (found count) > 0 ) section of the script.  Even though it reports in my logging that it is aware of the three found records.
>>
>> Any ideas?  Any suggestions of where to look?
>>
>> Thanks in advance,
>> Keith.
>> _______________________________________________
>> FMPexperts mailing list
>> [hidden email]
>> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
>
> _______________________________________________
> FMPexperts mailing list
> [hidden email]
> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Ideas needed for why script is taking so long

Stephen Wonfor-3
In reply to this post by Joel Stoner
Ketih, following Joels’  thoughts , your first layout should be trigger free.

eg. Go to Layout ("Maintenance - Invoice No Triggers”)

Stephen

---

“I think it’s a new feature.  Don’t tell anyone it was an accident.” --- Larry Wall

> On May 8, 2017, at 6:26 PM, Joel Stoner <[hidden email]> wrote:
>
> Remember that PSoS has no context until you give it some. Make sure you
> tell it what file / layout, etc it should be on at the beginning of the
> script, and that the account you're using to run the script has access to
> everything it needs. Also be aware of ScriptTriggers as Gordon said...
>
> On Mon, May 8, 2017 at 4:55 PM, Gordon Cox <[hidden email]> wrote:
>
>> Keith,
>>
>> Do you have an onFirstWindowOpen script trigger?
>>
>> If you onFirstWindowOpen takes a while that could be a cause which you
>> wouldn’t see as you already have the file open when running the script
>> locally?
>>
>>
>> Regards,
>>
>>   Gordon
>>
>>
>>> On 9 May 2017, at 7:39 am, Keith M. Rettig <[hidden email]>
>> wrote:
>>>
>>> I have a script that checks for records (status=0) that need to be sent
>> out via email.
>>> If I run the script on my desktop (server hosted db) in FMAdv15, it
>> takes the expected 4 seconds to run and runs perfectly.
>>> If it runs on the server under a scheduled script, it takes 104+ seconds
>> to run.
>>> What the heck?
>>>
>>> So I did the right thing and added a “set variable” step and recorded
>> the Get (CurrentTimestamp) after every step.
>>> Well it takes the script 100 seconds to do the very first step.  The
>> script is not even starting (despite the admin console indicating that it
>> has started.
>>>
>>>
>>> I have copy and pasted all of the steps into a new script and called
>> that in the Scheduled Script instead.
>>> I have created a new Scheduled Script.
>>> I changed the name of the layout.  Not sure why but I am reaching for
>> straws now.
>>> I removed the “Capture Errors” step (my first step in nearly every
>> script).  Not sure why but I am reaching for straws still.
>>> All to no avail?
>>>
>>> Oh, and get this; once it spends the 100 seconds to even start, it
>> completely ignores the found records and fails to perform the script steps
>> inside the IF( get (found count) > 0 ) section of the script.  Even though
>> it reports in my logging that it is aware of the three found records.
>>>
>>> Any ideas?  Any suggestions of where to look?
>>>
>>> Thanks in advance,
>>> Keith.
>>> _______________________________________________
>>> FMPexperts mailing list
>>> [hidden email]
>>> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
>>
>> _______________________________________________
>> FMPexperts mailing list
>> [hidden email]
>> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
>>
>
>
>
> --
>
>
> *Joel Stoner*
> *FounderAlterMedia, Inc. *(Studio Suite)
>
> 800.450.5740  ext. 101  (US and Canada)
> 818.955.9550  ext. 101  (Los Angeles)
>
> [hidden email]://www.studiosuite.net
>
>
> Think strategically.
> Improve your bottom line.
> Grow revenue & increase efficiency.
>
>
>  <http://www.twitter.com/studio_suite>
> <http://www.facebook.com/studiosuite>
> <http://www.linkedin.com/company/altermedia-inc->
> <https://plus.google.com/+AltermediaUS>
> <http://www.instagram.com/altermedia>
> <http://www.pinterest.com/studiosuite>
> <http://www.youtube.com/altermediainc>
> _______________________________________________
> FMPexperts mailing list
> [hidden email]
> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Ideas needed for why script is taking so long

John Weinshel
In reply to this post by tim ballering-2
If that were true, the script would more likely do the wrong thing, rather
than do the right thing slowly.

Something slow in the opener seems like a better bet.

Keith, at the top of the 'on open' script, add a test for
Get(ApplicationVersion). If it's server, exit the script.



On 5/8/17, 6:34 PM, "Tim Ballering" <[hidden email]> wrote:

>Are you on the proper layout and TO?
>
>My guess, because I¹ve made this mistake this before, is you¹ve take a
>client script that was called by a button on the correct layout and
>ported to Server without adding a go to layout step.
>
>Tim Ballering
>[hidden email]
>
>
>
>> On May 8, 2017, at 7:39 PM, Keith M. Rettig <[hidden email]>
>>wrote:
>>
>> I have a script that checks for records (status=0) that need to be sent
>>out via email.
>> If I run the script on my desktop (server hosted db) in FMAdv15, it
>>takes the expected 4 seconds to run and runs perfectly.
>> If it runs on the server under a scheduled script, it takes 104+
>>seconds to run.
>> What the heck?
>>
>> So I did the right thing and added a ³set variable² step and recorded
>>the Get (CurrentTimestamp) after every step.
>> Well it takes the script 100 seconds to do the very first step.  The
>>script is not even starting (despite the admin console indicating that
>>it has started.
>>
>>
>> I have copy and pasted all of the steps into a new script and called
>>that in the Scheduled Script instead.
>> I have created a new Scheduled Script.
>> I changed the name of the layout.  Not sure why but I am reaching for
>>straws now.
>> I removed the ³Capture Errors² step (my first step in nearly every
>>script).  Not sure why but I am reaching for straws still.
>> All to no avail?
>>
>> Oh, and get this; once it spends the 100 seconds to even start, it
>>completely ignores the found records and fails to perform the script
>>steps inside the IF( get (found count) > 0 ) section of the script.
>>Even though it reports in my logging that it is aware of the three found
>>records.
>>
>> Any ideas?  Any suggestions of where to look?
>>
>> Thanks in advance,
>> Keith.
>> _______________________________________________
>> FMPexperts mailing list
>> [hidden email]
>> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
>
>_______________________________________________
>FMPexperts mailing list
>[hidden email]
>http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au


_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Ideas needed for why script is taking so long

Keith M. Rettig
Thank you all so very much!
It was my onFirstOpenWindow script that was the issue.

All my files have “register 360Works plugins” as that script trigger.  I didn’t know that the FMSE runs that script trigger every time it runs.
I love 360Works’s stuff but the need to register their plugins every time you run a script on the server needs to be modified (I use the WPE a lot!).  I have had so much pain over the last the few months and so far every time it has been related to registering the plugins.  Mostly it is that I am doing it too often and then it kills the java engine on the server and then all hell breaks loose.

So this particular file, in an attempt to minimize its size, had a lot of the unneeded layouts, tables, and scripts deleted.  Looks like something that was needed was removed…
Interestingly, this means that every other script in this file was probably running a 100 seconds slow!  Now I have to wonder if it is happening in any of the other files on this server or the two other servers I have as well!  Yikes.

Again, thank you so very much.
Keith.



> On May 8, 2017, at 6:53 PM, John Weinshel <[hidden email]> wrote:
>
> If that were true, the script would more likely do the wrong thing, rather
> than do the right thing slowly.
>
> Something slow in the opener seems like a better bet.
>
> Keith, at the top of the 'on open' script, add a test for
> Get(ApplicationVersion). If it's server, exit the script.
>
>
>
> On 5/8/17, 6:34 PM, "Tim Ballering" <[hidden email] <mailto:[hidden email]>> wrote:
>
>> Are you on the proper layout and TO?
>>
>> My guess, because I¹ve made this mistake this before, is you¹ve take a
>> client script that was called by a button on the correct layout and
>> ported to Server without adding a go to layout step.
>>
>> Tim Ballering
>> [hidden email] <mailto:[hidden email]>
>>
>>
>>
>>> On May 8, 2017, at 7:39 PM, Keith M. Rettig <[hidden email] <mailto:[hidden email]>>
>>> wrote:
>>>
>>> I have a script that checks for records (status=0) that need to be sent
>>> out via email.
>>> If I run the script on my desktop (server hosted db) in FMAdv15, it
>>> takes the expected 4 seconds to run and runs perfectly.
>>> If it runs on the server under a scheduled script, it takes 104+
>>> seconds to run.
>>> What the heck?
>>> Any ideas?  Any suggestions of where to look?
>>>
>>> Thanks in advance,
>>> Keith.

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Ideas needed for why script is taking so long

Richard DeShong
Hi Folks,

As an opening caveat, I don't use server scheduled scripts.

I was thinking about a test/debug method for those that do create
scheduled scripts:

On your workstation, create an "opener" file that has a script that
calls the scheduled script.  You would close out of your FM client, and
then open this Opener file and run your scheduled script.  This would
allow you to see how your script runs with no "context".  Also, you
could open the script debugger before running the remote script.

If you have a number of scheduled scripts, you could simply add them to
this opener file so that you can test any maintenance updates.

Does this make sense?


On 5/8/2017 7:30 PM, Keith M. Rettig wrote:

> Thank you all so very much!
> It was my onFirstOpenWindow script that was the issue.
>
> All my files have “register 360Works plugins” as that script trigger.  I didn’t know that the FMSE runs that script trigger every time it runs.
> I love 360Works’s stuff but the need to register their plugins every time you run a script on the server needs to be modified (I use the WPE a lot!).  I have had so much pain over the last the few months and so far every time it has been related to registering the plugins.  Mostly it is that I am doing it too often and then it kills the java engine on the server and then all hell breaks loose.
>
> So this particular file, in an attempt to minimize its size, had a lot of the unneeded layouts, tables, and scripts deleted.  Looks like something that was needed was removed…
> Interestingly, this means that every other script in this file was probably running a 100 seconds slow!  Now I have to wonder if it is happening in any of the other files on this server or the two other servers I have as well!  Yikes.
>
> Again, thank you so very much.
> Keith.
>
>
>
>> On May 8, 2017, at 6:53 PM, John Weinshel <[hidden email]> wrote:
>>
>> If that were true, the script would more likely do the wrong thing, rather
>> than do the right thing slowly.
>>
>> Something slow in the opener seems like a better bet.
>>
>> Keith, at the top of the 'on open' script, add a test for
>> Get(ApplicationVersion). If it's server, exit the script.
>>
>>
>>
>> On 5/8/17, 6:34 PM, "Tim Ballering" <[hidden email] <mailto:[hidden email]>> wrote:
>>
>>> Are you on the proper layout and TO?
>>>
>>> My guess, because I¹ve made this mistake this before, is you¹ve take a
>>> client script that was called by a button on the correct layout and
>>> ported to Server without adding a go to layout step.
>>>
>>> Tim Ballering
>>> [hidden email] <mailto:[hidden email]>
>>>
>>>
>>>
>>>> On May 8, 2017, at 7:39 PM, Keith M. Rettig <[hidden email] <mailto:[hidden email]>>
>>>> wrote:
>>>>
>>>> I have a script that checks for records (status=0) that need to be sent
>>>> out via email.
>>>> If I run the script on my desktop (server hosted db) in FMAdv15, it
>>>> takes the expected 4 seconds to run and runs perfectly.
>>>> If it runs on the server under a scheduled script, it takes 104+
>>>> seconds to run.
>>>> What the heck?
>>>> Any ideas?  Any suggestions of where to look?
>>>>
>>>> Thanks in advance,
>>>> Keith.
> _______________________________________________
> FMPexperts mailing list
> [hidden email]
> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au

--
Richard DeShong
Logic Tools
510-642-5123 office
925-285-1088 cell

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Loading...