Flutter-Bounty-Hunters / static_shock

A static site generator for Dart.
MIT License
59 stars 5 forks source link

Move Mason Logger call during rebuild to avoid apparent logger race condition exception (Resolves #76) #77

Closed matthew-carroll closed 3 months ago

matthew-carroll commented 3 months ago

Move Mason Logger call during rebuild to avoid apparent logger race condition exception (Resolves #76)

The original issue #76 looks like it was probably already fixed but I was running an older version of the static_shock_cli. I wasn't able to recreate the crash when running the latest version of the CLI from local sources.

I did, however, move the mason_logger log statement such that it never attempts to log anything until after we've verified that we're not already building the website. There seems to be some kind of race condition with the logger that's causing an exception. Rather than repeatedly catch that exception and warn the user, I moved the log statement to a safe location.

I filed https://github.com/felangel/mason/issues/1280 with mason_logger.

This PR also upgrades mason_logger to 0.2.12, though this upgrade didn't solve the problem.