• Resolved ydcphilip

    (@ydcphilip)


    hello, I am trying to setup a cron job but failed.

    My condition:
    I am using wordpress to build my site. I am trying to import articles daily regularly by cron. The work flow is like this:
    1. upload csv to /public_html/wp-content/uploads/wpallimport/files/
    2. setup the import rules
    3. first cron to trigger the import
    4. second cron to process the import and repeat every two minutes

    Guide I follow: https://www.wpallimport.com/documentation/recurring/cron/

    However, before setting up the cron. I have to make sure the link works.

    For the first time trigger link, it shows {#622 Cron job triggered.”}
    For the first time process link, it shows {#622 completed.”}

    Unforturnately, the links only work at the first time. It seems when you visit the second time, it loads the cached result (I guess) and does not really send out commands to process.

    To test the problem:

    1. I prepared a test csv file in /wp-content/uploads/wpallimport/files/123-123.csv
    Go WordPress dashboard > All import > Manage import > find ID 662 > Scheduling Options > Under Manual Scheduling > find the Trigger URL and Processing URL

    2. To initiate the import: wp-load.php?import_key=XXXXX&import_id=622&action=trigger
    I see {“status”:200,”message”:”#622 Cron job triggered.”}

    3. To process the import: wp-load.php?import_key=xxxxxx&import_id=622&action=processing

    4. Then I changed the text(post title) in the test csv file (123-123.csv) to simulate a update.

    5. Then initiate the import again and it shows {“status”:200,”message”:”#622 Cron job triggered.”}

    6. Then process the import again (The result show instantly and that’s why I suspect its a cached result. The message shows “Import #622 is not triggered. Request skipped.”)

    If success, I should see the post title changed.

    I have installed the plugin W3 total cache. But I tried both enable and disabled it during the test and get the same problem. Thus, I don’t know if there is other cache like server cache or browser cache leading to this problem.
    Please test for me. Thank you

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author WP All Import

    (@wpallimport)

    Hey @ydcphilip,

    I have installed the plugin W3 total cache. But I tried both enable and disabled it during the test and get the same problem. Thus, I don’t know if there is other cache like server cache or browser cache leading to this problem.

    This is likely server-side caching or caching from another plugin. I would suggest contacting your web host and asking them if there’s anything on their end that could be caching it.

    If you’re not able to find what’s caching it, my suggestion would be to put a proxy PHP script on your server that adds a random number as a parameter in the cron URL, which would break the cache, then fetches it. Your cron jobs would then have to be edited to fetch the proxy script instead of the cron URLs directly.

    Plugin Author WP All Import

    (@wpallimport)

    Hi @ydcphilip,

    I’m going to mark this as resolved since it’s been a while. Let me know if you still have questions about this.

    Anyone else with questions, please open a new topic.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘cron job not working’ is closed to new replies.