Update (route)
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
|
||||
use App\Jobs\ParseRssPostMetadataJob;
|
||||
use App\Models\RssPost;
|
||||
use App\Models\ServiceCostUsage;
|
||||
use Exception;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use League\HTMLToMarkdown\HtmlConverter;
|
||||
@@ -34,7 +35,16 @@ public static function handle(int $rss_post_id)
|
||||
|
||||
if ($response->successful()) {
|
||||
$raw_html = $response->body();
|
||||
$costs['unblocker'] = calculate_smartproxy_cost(round(strlen($raw_html) / 1024, 2), 'rotating_global');
|
||||
$cost = calculate_smartproxy_cost(round(strlen($raw_html) / 1024, 2), 'rotating_global');
|
||||
|
||||
$service_cost_usage = new ServiceCostUsage;
|
||||
$service_cost_usage->cost = $cost;
|
||||
$service_cost_usage->name = 'smartproxy-CrawlRssPostTask';
|
||||
$service_cost_usage->reference_1 = 'rss_post';
|
||||
$service_cost_usage->reference_2 = strval($rss_post_id);
|
||||
$service_cost_usage->output = null;
|
||||
$service_cost_usage->save();
|
||||
|
||||
} else {
|
||||
$raw_html = null;
|
||||
$response->throw();
|
||||
|
||||
Reference in New Issue
Block a user