Questions about ecshop scheduled tasks

Source: Internet
Author: User
For ecshop scheduled task problems, I made a scheduled task plug-in that automatically sends emails. all my sites have a scheduled task trigger code: & lt; imgstyle = & quot; width: 0px; height: 0px; border: 0 & quot; src = & quot; api/crop. php & quot; & gt;, I set the task to be executed at every morning.
I made a scheduled task plug-in to automatically send emails. all my sites have a scheduled task trigger code: I set the task to be executed at every morning, all the minutes (0-60) are added in the minute. after the execution, the unselected and advanced options are disabled. this plug-in is enabled all the time.
The problem now is that the refreshing page trigger program will be interrupted when it is executed to call the external sending method (I will write the external method in and won't interrupt ), I click "execute" in the "scheduled task" list in the background to complete the execution. how can I make the program execute all the way regardless of the position of the mail method?
In addition, I used both ignore_user_abort (true) and set_time_limit (0.



------ Solution --------------------
Since it is "refreshing the page trigger program will be interrupted when it is executed to call the external sending method ". Write a url for sending text messages.
Then, use fsockopen to put data in.

$ Fp = fsockopen ("www.example.com", 80, $ errno, $ errstr, 30 );
If (! $ Fp ){
Echo "$ errstr ($ errno)
\ N ";
} Else {
$ Out = "GET/HTTP/1.1 \ r \ n ";
$ Out. = "Host: www.example.com \ r \ n ";
$ Out. = "Connection: Close \ r \ n ";
Fwrite ($ fp, $ out );
While (! Feof ($ fp )){
Echo fgets ($ fp, 128 );
}
Fclose ($ fp );
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.