Skip to content

Commit 42e3524

Browse files
authored
Merge pull request #683 from OpenLitterMap/feature/sentry
Add Sentry
2 parents 3249c86 + eb2ab6f commit 42e3524

File tree

8 files changed

+650
-8
lines changed

8 files changed

+650
-8
lines changed

.env.example

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ MAIL_ENCRYPTION=null
4040

4141
STRIPE_KEY=
4242
STRIPE_SECRET=
43-
STRIPE_MODEL=App\User
43+
STRIPE_MODEL=App\Models\Users\User
4444
MIX_STRIPE_KEY=
4545
MIX_STRIPE_PUBLIC_KEY=
4646

47-
CASHIER_MODEL=App\User
47+
CASHIER_MODEL=App\Models\Users\User
4848
CASHIER_CURRENCY=eur
4949

5050
AWS_KEY=homestead
@@ -90,6 +90,10 @@ VITE_REVERB_HOST="${REVERB_HOST}"
9090
VITE_REVERB_PORT="${REVERB_PORT}"
9191
VITE_REVERB_SCHEME="${REVERB_SCHEME}"
9292

93+
SENTRY_LARAVEL_DSN=
94+
SENTRY_TRACES_SAMPLE_RATE=0
95+
SENTRY_SEND_DEFAULT_PII=false
96+
9397
OPTIMIZE="true"
9498
NETWORK=preprod
9599
NETWORK_PARAMS_FILE="preprod.json"

app/Listeners/Littercoin/RewardLittercoin.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use App\Models\Photo;
99
use Illuminate\Contracts\Queue\ShouldQueue;
1010
use Illuminate\Queue\InteractsWithQueue;
11+
use Illuminate\Support\Facades\DB;
1112
use App\Services\Redis\RedisKeys;
1213
use Illuminate\Support\Facades\Redis;
1314

@@ -29,10 +30,12 @@ public function handle (TagsVerifiedByAdmin $event)
2930

3031
if ($count === 100)
3132
{
32-
Littercoin::firstOrCreate([
33-
'user_id' => $event->user_id,
34-
'photo_id' => $event->photo_id
35-
]);
33+
DB::transaction(function () use ($event) {
34+
Littercoin::firstOrCreate([
35+
'user_id' => $event->user_id,
36+
'photo_id' => $event->photo_id
37+
]);
38+
}, 3);
3639

3740
// Broadcast an event to anyone viewing the global map
3841
event(new LittercoinMined($event->user_id, '100-images-verified'));

app/Providers/AppServiceProvider.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use Illuminate\Database\Eloquent\Relations\Relation;
1414
use Illuminate\Support\Facades\Gate;
1515
use Illuminate\Support\ServiceProvider;
16+
use Laravel\Cashier\Cashier;
1617

1718
class AppServiceProvider extends ServiceProvider
1819
{
@@ -41,6 +42,8 @@ public function boot()
4142

4243
Photo::observe(PhotoObserver::class);
4344

45+
Cashier::useCustomerModel(User::class);
46+
4447
Gate::define('viewPulse', function (User $user) {
4548
return $user->hasRole('superadmin');
4649
});

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"maatwebsite/excel": "^3.1",
3131
"openai-php/client": "^0.10.3",
3232
"pusher/pusher-php-server": "^7.0",
33+
"sentry/sentry-laravel": "^4.24",
3334
"spatie/browsershot": "^4.3",
3435
"spatie/emoji": "^4.0",
3536
"spatie/laravel-backup": "^8.0",

0 commit comments

Comments
 (0)