paulwer 2023-12-25 08:12:35 +01:00
parent 6470f501af
commit 5fa4bf44d5

View File

@ -45,10 +45,25 @@ class BankTransactionSync implements ShouldQueue
*/ */
public function handle() public function handle()
{ {
// multiDB environment, need to @turbo124 do we need any changes here for selfhosted non-multidb envs if (config('ninja.db.multi_db_enabled')) {
foreach (MultiDB::$dbs as $db) { foreach (MultiDB::$dbs as $db) {
MultiDB::setDB($db); MultiDB::setDB($db);
$this->processYodlee();
$this->processNordigen();
}
} else {
$this->processYodlee();
$this->processNordigen();
}
nlog("syncing transactions - done");
}
private function processYodlee()
{
if (Ninja::isHosted()) { // @turbo124 @todo I migrated the schedule for the job within the kernel to execute on all platforms and use the same expression here to determine if yodlee can run or not. Please chek/verify if (Ninja::isHosted()) { // @turbo124 @todo I migrated the schedule for the job within the kernel to execute on all platforms and use the same expression here to determine if yodlee can run or not. Please chek/verify
nlog("syncing transactions - yodlee"); nlog("syncing transactions - yodlee");
@ -62,6 +77,10 @@ class BankTransactionSync implements ShouldQueue
}); });
} }
}
private function processNordigen()
{
if (config("ninja.nordigen.secret_id") && config("ninja.nordigen.secret_key")) { // @turbo124 check condition, when to execute this should be placed here (isSelfHosted || isPro/isEnterprise) if (config("ninja.nordigen.secret_id") && config("ninja.nordigen.secret_key")) { // @turbo124 check condition, when to execute this should be placed here (isSelfHosted || isPro/isEnterprise)
nlog("syncing transactions - nordigen"); nlog("syncing transactions - nordigen");
@ -76,8 +95,5 @@ class BankTransactionSync implements ShouldQueue
}); });
} }
nlog("syncing transactions - done");
}
} }
} }