Discourse::sync_to_discourse PHP Method

sync_to_discourse() public method

public sync_to_discourse ( $postid, $title, $raw )
    function sync_to_discourse($postid, $title, $raw)
    {
        global $wpdb;
        // this avoids a double sync, just 1 is allowed to go through at a time
        $got_lock = $wpdb->get_row("SELECT GET_LOCK('discourse_sync_lock', 0) got_it");
        if ($got_lock) {
            self::sync_to_discourse_work($postid, $title, $raw);
            $wpdb->get_results("SELECT RELEASE_LOCK('discourse_sync_lock')");
        }
    }