mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 13:12:50 +01:00
Add logging for migrations
This commit is contained in:
parent
4e10d4665e
commit
e0758e587f
@ -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) {
|
||||
|
@ -73,6 +73,8 @@ class StartMigration implements ShouldQueue
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
nlog("Inside Migration Job");
|
||||
|
||||
set_time_limit(0);
|
||||
|
||||
MultiDB::setDb($this->company->db);
|
||||
|
Loading…
Reference in New Issue
Block a user