diff --git a/app/Repositories/ToolRepository.php b/app/Repositories/ToolRepository.php index cb6b928be..72724c5dc 100644 --- a/app/Repositories/ToolRepository.php +++ b/app/Repositories/ToolRepository.php @@ -39,7 +39,7 @@ public function backupDatabase() $config = config("database.connections.$connectionName"); $filename = sprintf('%s/%s.database.%s.sql', sys_get_temp_dir(), basename(base_path()), date('Ymd.His')); $command = sprintf( - 'mysqldump --user=%s --password=%s --port=%s --single-transaction --databases %s >> %s', + 'mysqldump --user=%s --password=%s --port=%s --single-transaction --no-create-db --databases %s >> %s', $config['username'], $config['password'], $config['port'], $config['database'], $filename, ); $result = exec($command, $output, $result_code); diff --git a/app/Repositories/TrackerRepository.php b/app/Repositories/TrackerRepository.php index c80da6e8f..dfc70f20d 100644 --- a/app/Repositories/TrackerRepository.php +++ b/app/Repositories/TrackerRepository.php @@ -128,13 +128,7 @@ public function announce(Request $request): \Illuminate\Http\Response do_log("[" . get_class($exception) . "] " . $exception->getMessage() . "\n" . $exception->getTraceAsString(), 'error'); $repDict = $this->generateFailedAnnounceResponse("system error, report to sysop please, hint: " . nexus()->getRequestId()); } finally { - $setUpdate = "[USER_SET_UPDATE] user: " . $user->id; - foreach ($this->userUpdates as $key => $value) { - $setUpdate .= ", $key = $value"; - } - do_log($setUpdate); if (isset($user) && count($this->userUpdates)) { -// $user->update($this->userUpdates); $user->fill($this->userUpdates); $willBeUpdate = "[USER_ACTUAL_UPDATE] user: " . $user->id; foreach ($user->getDirty() as $key => $value) { @@ -862,10 +856,15 @@ public function scrape(Request $request): \Illuminate\Http\Response do_log("[" . get_class($exception) . "] " . $exception->getMessage() . "\n" . $exception->getTraceAsString(), 'error'); $repDict = $this->generateFailedAnnounceResponse("system error, report to sysop please, hint: " . nexus()->getRequestId()); } finally { - do_log("userUpdates: " . nexus_json_encode($this->userUpdates)); if (isset($user) && count($this->userUpdates)) { - $user->update($this->userUpdates); - do_log(last_query(), 'debug'); + $user->fill($this->userUpdates); + $willBeUpdate = "[USER_ACTUAL_UPDATE] user: " . $user->id; + foreach ($user->getDirty() as $key => $value) { + $willBeUpdate .= ", $key = $value"; + } + do_log($willBeUpdate); + $user->save(); + do_log(last_query()); } return $this->sendFinalAnnounceResponse($repDict); } diff --git a/include/constants.php b/include/constants.php index 46b1a4a02..b7e2c6934 100644 --- a/include/constants.php +++ b/include/constants.php @@ -1,6 +1,6 @@