File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
app/code/Magento/Directory Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 12
12
13
13
namespace Magento \Directory \Model ;
14
14
15
+ /**
16
+ * Class Observer
17
+ *
18
+ * @package Magento\Directory\Model
19
+ */
15
20
class Observer
16
21
{
17
22
const CRON_STRING_PATH = 'crontab/default/jobs/currency_rates_update/schedule/cron_expr ' ;
@@ -83,6 +88,8 @@ public function __construct(
83
88
}
84
89
85
90
/**
91
+ * Schedule update currency rates
92
+ *
86
93
* @param mixed $schedule
87
94
* @return void
88
95
* @throws \Exception
@@ -122,7 +129,7 @@ public function scheduledUpdateCurrencyRates($schedule)
122
129
$ importWarnings [] = __ ('FATAL ERROR: ' ) . ' ' . __ ('Please specify the correct Import Service. ' );
123
130
}
124
131
125
- if (sizeof ($ errors ) > 0 ) {
132
+ if (count ($ errors ) > 0 ) {
126
133
foreach ($ errors as $ error ) {
127
134
$ importWarnings [] = __ ('WARNING: ' ) . ' ' . $ error ;
128
135
}
@@ -132,7 +139,7 @@ public function scheduledUpdateCurrencyRates($schedule)
132
139
self ::XML_PATH_ERROR_RECIPIENT ,
133
140
\Magento \Store \Model \ScopeInterface::SCOPE_STORE
134
141
);
135
- if (sizeof ($ importWarnings ) == 0 ) {
142
+ if (count ($ importWarnings ) == 0 ) {
136
143
$ this ->_currencyFactory ->create ()->saveRates ($ rates );
137
144
} elseif ($ errorRecipient ) {
138
145
//if $errorRecipient is not set, there is no sense send email to nobody
Original file line number Diff line number Diff line change 7
7
-->
8
8
<config xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" xsi : noNamespaceSchemaLocation =" urn:magento:module:Magento_Cron:etc/crontab.xsd" >
9
9
<group id =" default" >
10
- <job name =" currency_rates_update" instance =" Magento\Directory\Model\Observer" method =" scheduledUpdateCurrencyRates" />
10
+ <job name =" currency_rates_update" instance =" Magento\Directory\Model\Observer" method =" scheduledUpdateCurrencyRates" >
11
+ <config_path >crontab/default/jobs/currency_rates_update/schedule/cron_expr</config_path >
12
+ </job >
11
13
</group >
12
14
</config >
You can’t perform that action at this time.
0 commit comments