mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-19 02:45:58 +00:00
Better disable thing.
This commit is contained in:
@@ -48,6 +48,9 @@ class ExchangeRateConverter
|
|||||||
*/
|
*/
|
||||||
public function convert(TransactionCurrency $from, TransactionCurrency $to, Carbon $date, string $amount): string
|
public function convert(TransactionCurrency $from, TransactionCurrency $to, Carbon $date, string $amount): string
|
||||||
{
|
{
|
||||||
|
if(false === config('cer.enabled')) {
|
||||||
|
return $amount;
|
||||||
|
}
|
||||||
Log::debug('convert()');
|
Log::debug('convert()');
|
||||||
$rate = $this->getCurrencyRate($from, $to, $date);
|
$rate = $this->getCurrencyRate($from, $to, $date);
|
||||||
|
|
||||||
@@ -59,6 +62,9 @@ class ExchangeRateConverter
|
|||||||
*/
|
*/
|
||||||
public function getCurrencyRate(TransactionCurrency $from, TransactionCurrency $to, Carbon $date): string
|
public function getCurrencyRate(TransactionCurrency $from, TransactionCurrency $to, Carbon $date): string
|
||||||
{
|
{
|
||||||
|
if(false === config('cer.enabled')) {
|
||||||
|
return '1';
|
||||||
|
}
|
||||||
Log::debug('getCurrencyRate()');
|
Log::debug('getCurrencyRate()');
|
||||||
$rate = $this->getRate($from, $to, $date);
|
$rate = $this->getRate($from, $to, $date);
|
||||||
|
|
||||||
@@ -233,6 +239,9 @@ class ExchangeRateConverter
|
|||||||
*/
|
*/
|
||||||
public function prepare(TransactionCurrency $from, TransactionCurrency $to, Carbon $start, Carbon $end): void
|
public function prepare(TransactionCurrency $from, TransactionCurrency $to, Carbon $start, Carbon $end): void
|
||||||
{
|
{
|
||||||
|
if(false === config('cer.enabled')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
Log::debug('prepare()');
|
Log::debug('prepare()');
|
||||||
$start->startOfDay();
|
$start->startOfDay();
|
||||||
$end->endOfDay();
|
$end->endOfDay();
|
||||||
@@ -305,6 +314,9 @@ class ExchangeRateConverter
|
|||||||
|
|
||||||
public function summarize(): void
|
public function summarize(): void
|
||||||
{
|
{
|
||||||
|
if(false === config('cer.enabled')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
Log::debug(sprintf('ExchangeRateConverter ran %d queries.', $this->queryCount));
|
Log::debug(sprintf('ExchangeRateConverter ran %d queries.', $this->queryCount));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user