fix: fetch pending with token in query string to survive LiteSpeed caching
This commit is contained in:
@@ -87,7 +87,7 @@ function wp_rest_call( string $url, string $token, string $method = 'GET', array
|
||||
|
||||
if ( $action === 'pending' ) {
|
||||
vps_log( "Fetching pending articles from {$wp_url}/wp-json/peptide-news/v1/worker/pending ..." );
|
||||
$res = wp_rest_call( "{$wp_url}/wp-json/peptide-news/v1/worker/pending?limit={$batch}", $token );
|
||||
$res = wp_rest_call( "{$wp_url}/wp-json/peptide-news/v1/worker/pending?limit={$batch}&token={$token}", $token );
|
||||
if ( ! $res || empty( $res['success'] ) ) {
|
||||
vps_log( "Failed to retrieve pending articles." );
|
||||
exit( 1 );
|
||||
@@ -105,7 +105,7 @@ if ( $action === 'process-llm' ) {
|
||||
exit( 1 );
|
||||
}
|
||||
vps_log( "Pulling up to {$batch} pending articles from WordPress..." );
|
||||
$res = wp_rest_call( "{$wp_url}/wp-json/peptide-news/v1/worker/pending?limit={$batch}", $token );
|
||||
$res = wp_rest_call( "{$wp_url}/wp-json/peptide-news/v1/worker/pending?limit={$batch}&token={$token}", $token );
|
||||
if ( ! $res || empty( $res['success'] ) || empty( $res['data'] ) ) {
|
||||
vps_log( "No pending articles found or failed to retrieve." );
|
||||
exit( 0 );
|
||||
|
||||
Reference in New Issue
Block a user