Having just updated to Commerce 2.37 and got the new dashboard (thank you), I have been struck by how slow cron calls have become. Our sites call cron as needed multiple times a minute to process queue items and other background tasks. That processing was backing up due to an additional 1-5 seconds on every cron call which couldn't be accounted for, except for one module update.
We found that InboxMessageFetcher::fetch() is called on every cron call, instead of every X hours. This fetch is slow due to DNS lookups (cached for 10s and 60s, with NS only cached for 5m) and a slow web server. Minimum turn-around is 1.8 seconds, but also up to 5s.
I would think that the inbox messages only need to be retrieved every day or week instead of tied directly to cron.
Also appears you need to add "Dashboard" as a component to report bugs on.
Why do you use Drupal\Core\Site\Settings instead of Drupal\Core\Config\Config? This would allow for adjusting of config through UI. I have not included this setting in a form because there seems to be no other config form for commerce core.
Issue fork commerce-3414195
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
elc commentedTest failures do not appear to be related to this issue. There do not appear to be any tests for the dashboard as yet.
Setting to NR for this issue, ignoring the failing tests.
Comment #4
jsacksick commentedThe test failures are definitely related :). Did you open the tests?
I suggest we keep it simple and just fetch once a day like you did without making this configurable. This was actually part of our initial internal requirements (and was overlooked I guess).
As for settings vs config, that's the route we've decided to take for now, as it's easy enough to just edit the settings.php as needed as long as it's documented.
Comment #5
jsacksick commentedOk, I got rid of the config object introduced. I think it's fine to just hardcode the run interval to once a day for now. I think the tests will be green again.
Comment #8
jsacksick commentedWent ahead and merged the MR. Thanks for reporting this.