Skip to content

Commit 5e7e3a3

Browse files
update
1 parent 438c021 commit 5e7e3a3

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/Bolt.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ final class Bolt
2727
public function __construct(private IConnection $connection)
2828
{
2929
$_ENV['TEMP_DIR'] = getenv('TEMP') ?: getenv('TMPDIR') ?: (dirname(__DIR__) . DIRECTORY_SEPARATOR . 'temp');
30-
var_dump($_ENV['TEMP_DIR']);
3130
if (!file_exists($_ENV['TEMP_DIR'])) {
3231
mkdir($_ENV['TEMP_DIR'], recursive: true);
3332
}
@@ -48,12 +47,11 @@ private function track(): void
4847
$time = intval(explode('.', basename($file))[1]);
4948
if ($time < strtotime('today')) {
5049
$count = file_get_contents($file);
51-
unlink($file);
5250

5351
$curl = curl_init();
5452
curl_setopt_array($curl, [
5553
CURLOPT_URL => 'https://api-eu.mixpanel.com/import?strict=0&project_id=3355308',
56-
CURLOPT_RETURNTRANSFER => true,
54+
CURLOPT_RETURNTRANSFER => false,
5755
CURLOPT_ENCODING => '',
5856
CURLOPT_MAXREDIRS => 10,
5957
CURLOPT_TIMEOUT => $this->connection->getTimeout(),
@@ -77,7 +75,10 @@ private function track(): void
7775
'authorization: Basic MDJhYjRiOWE2YTM4MThmNWFlZDEzYjNiMmE5M2MxNzQ6',
7876
],
7977
]);
80-
curl_exec($curl);
78+
79+
if (curl_exec($curl)) {
80+
unlink($file);
81+
}
8182
curl_close($curl);
8283
}
8384
}

0 commit comments

Comments
 (0)