Updated changelog

This commit is contained in:
Henry Whitaker
2020-08-25 21:23:06 +01:00
parent 900ecb2218
commit 1fcdd5bb1d
6 changed files with 28 additions and 18 deletions

View File

@@ -263,8 +263,12 @@ class SpeedtestHelper {
if(env('DB_CONNECTION') === 'sqlite') {
if(env('DB_DATABASE') !== null) {
$current = env('DB_DATABASE');
if(File::copy($current, $current . '.bak')) {
return true;
try {
if(File::copy($current, $current . '.bak')) {
return true;
}
}catch(Exception $e) {
return false;
}
}
@@ -283,23 +287,18 @@ class SpeedtestHelper {
{
Cache::flush();
if(SpeedtestHelper::dbBackup() !== false) {
if(sizeof(Speedtest::whereNotNull('id')->get()) > 0) {
if(Speedtest::whereNotNull('id')->delete()) {
return [
'success' => true,
];
}
}
SpeedtestHelper::dbBackup();
return [
'success' => true,
];
if(sizeof(Speedtest::whereNotNull('id')->get()) > 0) {
if(Speedtest::whereNotNull('id')->delete()) {
return [
'success' => true,
];
}
}
return [
'success' => false,
'msg' => 'There was an error backing up the database. No speedtests have been deleted.'
'success' => true,
];
}

View File

@@ -78,7 +78,7 @@ class IntegrationsController extends Controller
SettingsHelper::testNotification();
return response()->json([
'method' => 'test notificaiton agents'
'method' => 'test notification agents'
], 200);
}
}

View File

@@ -144,6 +144,7 @@ class SpeedtestController extends Controller
public function run()
{
try {
SettingsHelper::loadIntegrationConfig();
$data = SpeedtestJob::dispatch(false, config('integrations'));
return response()->json([
'method' => 'run speedtest',