解決済WP Crontrolによるwcdl_eventの実行について

フォーラム 拡張プラグイン 【解決済】WP Crontrolによるwcdl_eventの実行について

  • このトピックには2件の返信、2人の参加者があり、最後にunisonにより7ヶ月、 4週前に更新されました。
3件の投稿を表示中 - 1 - 3件目 (全3件中)
  • 投稿者
    投稿
  • #100689
    unison
    参加者

    WordPress のバージョン:6.2.2
    Welcart のバージョン:Version 2.8.19.2307061
    PHP のバージョン:8.0.25
    Welcart専用の拡張プラグインとバージョン:WCEX DL Seller 3.4.7
    症状を確認したブラウザ:chrome
    サーバー【重要】:Xserver

    WP Crontrolでwcdl_eventの実行についての質問なのですが

    plugins/wcex_dlseller/wcex_dlseller.phpのdlseller_do_eventを呼び出しているようですが
    その中で下記のfunctionを呼び出しをして最初にチェックをしています。

    $todayと$acc_dateがイコールになってバッチが起動していないのですが、
    $todayと$acc_dateが一致しないような設定は可能でしょうか?

    function dlseller_event_mark() {
    global $wpdb;

    $today = date_i18n( ‘Y-m-d’, current_time( ‘timestamp’ ) );

    usces_log( ‘dlseller_event_mark:’ . $today, ‘dlseller.log’ );
    $table_name = $wpdb->prefix . ‘usces_access’;
    $query = $wpdb->prepare( “SELECT acc_date FROM {$table_name} WHERE acc_key = %s LIMIT 1”, ‘wcdl_event’ );

    $acc_date = $wpdb->get_var( $query );
    if ( $acc_date === $today ) {

    usces_log( ‘acc_date:’ . $acc_date, ‘dlseller.log’ );
    usces_log( ‘today:’ . $acc_date, ‘dlseller.log’ );
    return false;
    }

    sleep( rand( 1, 10 ) );

    if ( $acc_date ) {
    $query = $wpdb->prepare( “UPDATE {$table_name} SET acc_date = %s WHERE acc_key = %s LIMIT 1”, $today, ‘wcdl_event’ );
    } else {
    $query = $wpdb->prepare( “INSERT INTO {$table_name} (acc_date, acc_key) VALUES (%s, %s)”, $today, ‘wcdl_event’ );
    }
    $res = $wpdb->query( $query );
    if ( ! $res ) {
    usces_log( ‘dlseller_event_mark:*** Stopped the automatic processing. ***’, ‘dlseller.log’ );
    return false;
    }
    return true;
    }

    #100697
    ikeda
    キーマスター

    unison 様
    こんにちは。
    1日1回しか処理を実行しないようにするための条件ですので変更することはできません。
    恐れ入りますがご理解いただければと思います。

    #100722
    unison
    参加者

    承知しました。
    回答ありがとうございます。

3件の投稿を表示中 - 1 - 3件目 (全3件中)
  • このトピックに返信するにはログインが必要です。