1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-05 18:52:44 +01:00

Add logging for migrations

This commit is contained in:
David Bomba 2021-01-28 13:53:40 +11:00
parent 4e10d4665e
commit e0758e587f
2 changed files with 9 additions and 0 deletions

View File

@ -218,6 +218,8 @@ class MigrationController extends BaseController
*/
public function startMigration(Request $request)
{
nlog("Starting Migration");
$companies = json_decode($request->companies);
if (app()->environment() === 'local') {
@ -290,6 +292,9 @@ class MigrationController extends BaseController
// If there's no existing company migrate just normally.
if ($checks['existing_company'] == false) {
nlog("creating fresh company");
$account = auth()->user()->account;
$fresh_company = (new ImportMigrations())->getCompany($account);
@ -325,11 +330,13 @@ class MigrationController extends BaseController
);
if (app()->environment() == 'testing') {
nlog("environment is testing = bailing out now");
return;
}
try {
// StartMigration::dispatch(base_path("storage/app/public/$migration_file"), $user, $fresh_company)->delay(now()->addSeconds(5));
nlog("starting migration job");
nlog($migration_file);
StartMigration::dispatch($migration_file, $user, $fresh_company);
} catch (\Exception $e) {

View File

@ -73,6 +73,8 @@ class StartMigration implements ShouldQueue
*/
public function handle()
{
nlog("Inside Migration Job");
set_time_limit(0);
MultiDB::setDb($this->company->db);