Closed ghost closed 3 years ago
What do you mean it yields during the metamethod? ProfileService should probably be enabled as a standalone module.
The Standalone setting that is provided does not change the fact that the module is required inside of a metamethod. Here is the function that loads modules: https://github.com/Sleitnick/AeroGameFramework/blob/43e7f969b87ce0aacca1db0f200a0578df12383c/src/ServerScriptService/Aero/Internal/AeroServer.server.lua#L177-L202
I feel as though this PR should be in the ProfileService module, as the issue is actually a problem with the module.
I think this might actually be more of an issue with the LazyLoadSetup
function. The fact that it prevents yielding within Start
is concerning. The whole point of Start
being executed asynchronously is to allow yielding.
I think I might be able to use Thread.SpawnNow
to escape from the metamethod issue. I'll do some tests.
Any update on this? We had to manually update our ProfileService file but this could confuse new users.
Thanks for the PR. I decided to also update to latest ProfileService and made sure to include the coroutine.wrap()
section. Done within https://github.com/Sleitnick/AeroGameFramework/pull/206
ProfileService makes a datastore call when initializing which causes the metamethod to yield. Although this only occurs in studio, it causes the entire framework to break. Wrapping the call in a coroutine fixed the issue.