quantum-elixir / quantum-core

:watch: Cron-like job scheduler for Elixir
https://hexdocs.pm/quantum/
Apache License 2.0
2.28k stars 148 forks source link

fix problem with non-exported function #603

Closed maxpohlmann closed 4 months ago

maxpohlmann commented 4 months ago

We had a problem where Quantum could only schedule a job right after executing mix clean, but with every call to mix after that, our configured jobs were not scheduled, because function_exported?/3 returned false, even though the function still existed, but apparently was not yet exported at the time the Quantum code executed. This PR fixes this by calling Code.ensure_loaded?/1 before function_exported?/3, which actively tries to load the module before returning true if this was successful or false otherwise (e.g. if the module does not exist).

coveralls commented 4 months ago

Pull Request Test Coverage Report for Build 7047ec21deddb8daa1a64b6a04869c7a6d3fa56b-PR-603

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details


Totals Coverage Status
Change from base Build 0c34ca8dc6937f148b6e272dfd621251e6da8765: 0.03%
Covered Lines: 351
Relevant Lines: 406

💛 - Coveralls
maxpohlmann commented 4 months ago

Thank you! :)