Skip to content

Commit

Permalink
Merge pull request #175 from Astrotomic/dev
Browse files Browse the repository at this point in the history
update
  • Loading branch information
Gummibeer committed Jul 11, 2023
2 parents 4b75d1f + 77582c2 commit 5da1ec1
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 6 deletions.
4 changes: 0 additions & 4 deletions app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
use Spatie\Backup\Commands\BackupCommand;
use Spatie\Backup\Commands\CleanupCommand;
use Spatie\Backup\Commands\MonitorCommand;
use Spatie\ScheduleMonitor\Commands\CleanLogCommand;

class Kernel extends ConsoleKernel
{
Expand Down Expand Up @@ -46,9 +45,6 @@ protected function schedule(Schedule $schedule): void
// laravel/scout
$schedule->command(ReImportCommand::class)->everyThreeHours()->onOneServer();

// spatie/laravel-schedule-monitor
$schedule->command(CleanLogCommand::class)->dailyAt('00:00')->onOneServer();

// spatie/laravel-backup
$schedule->command(BackupCommand::class)->twiceDaily(1, 13);
$schedule->command(CleanupCommand::class)->dailyAt('09:00');
Expand Down
12 changes: 11 additions & 1 deletion app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,17 @@ public function boot(): void
});

Storage::extend('dropbox', static function (Container $app, array $config): FilesystemContract {
$client = new DropboxClient($config['access_token']);
$accessToken = Http::baseUrl('https://api.dropboxapi.com')
->timeout(5)
->retry(3, 50)
->withBasicAuth($config['app_key'], $config['app_secret'])
->post('/oauth2/token?'.Arr::query([
'grant_type' => 'refresh_token',
'refresh_token' => $config['refresh_token'],
]))
->json('access_token');

$client = new DropboxClient($accessToken);
$adapter = new DropboxAdapter($client);
$config = array_merge($config, ['case_sensitive' => false]);

Expand Down
4 changes: 3 additions & 1 deletion config/filesystems.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@

'backups' => [
'driver' => 'dropbox',
'access_token' => env('BACKUP_DROPBOX_ACCESS_TOKEN'),
'app_key' => env('BACKUP_DROPBOX_APP_KEY'),
'app_secret' => env('BACKUP_DROPBOX_APP_SECRET'),
'refresh_token' => env('BACKUP_DROPBOX_REFRESH_TOKEN'),
'throw' => true,
],

Expand Down
7 changes: 7 additions & 0 deletions k6.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,15 @@ export default function () {
'https://opendor.me/faqs',
'https://opendor.me/faqs',
'https://opendor.me/sponsors',
'https://opendor.me/sponsors',
'https://opendor.me/@Gummibeer',
'https://opendor.me/@Gummibeer',
'https://opendor.me/@Gummibeer',
'https://opendor.me/@Gummibeer',
'https://opendor.me/@Astrotomic',
'https://opendor.me/@Astrotomic',
'https://opendor.me/@Astrotomic',
'https://opendor.me/@Astrotomic',
].random();

let res = http.get(url);
Expand Down

0 comments on commit 5da1ec1

Please sign in to comment.