mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04: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)
|
public function startMigration(Request $request)
|
||||||
{
|
{
|
||||||
|
nlog("Starting Migration");
|
||||||
|
|
||||||
$companies = json_decode($request->companies);
|
$companies = json_decode($request->companies);
|
||||||
|
|
||||||
if (app()->environment() === 'local') {
|
if (app()->environment() === 'local') {
|
||||||
@ -290,6 +292,9 @@ class MigrationController extends BaseController
|
|||||||
|
|
||||||
// If there's no existing company migrate just normally.
|
// If there's no existing company migrate just normally.
|
||||||
if ($checks['existing_company'] == false) {
|
if ($checks['existing_company'] == false) {
|
||||||
|
|
||||||
|
nlog("creating fresh company");
|
||||||
|
|
||||||
$account = auth()->user()->account;
|
$account = auth()->user()->account;
|
||||||
$fresh_company = (new ImportMigrations())->getCompany($account);
|
$fresh_company = (new ImportMigrations())->getCompany($account);
|
||||||
|
|
||||||
@ -325,11 +330,13 @@ class MigrationController extends BaseController
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (app()->environment() == 'testing') {
|
if (app()->environment() == 'testing') {
|
||||||
|
nlog("environment is testing = bailing out now");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// StartMigration::dispatch(base_path("storage/app/public/$migration_file"), $user, $fresh_company)->delay(now()->addSeconds(5));
|
// StartMigration::dispatch(base_path("storage/app/public/$migration_file"), $user, $fresh_company)->delay(now()->addSeconds(5));
|
||||||
|
nlog("starting migration job");
|
||||||
nlog($migration_file);
|
nlog($migration_file);
|
||||||
StartMigration::dispatch($migration_file, $user, $fresh_company);
|
StartMigration::dispatch($migration_file, $user, $fresh_company);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
|
@ -73,6 +73,8 @@ class StartMigration implements ShouldQueue
|
|||||||
*/
|
*/
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
|
nlog("Inside Migration Job");
|
||||||
|
|
||||||
set_time_limit(0);
|
set_time_limit(0);
|
||||||
|
|
||||||
MultiDB::setDb($this->company->db);
|
MultiDB::setDb($this->company->db);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user