mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-01 22:21:51 +00:00
refactor(database): waitForConnection
This commit is contained in:
1 parent
2a5e110e29
commit
bc8a874743
5 files changed
+30
-22
No files matched your search
@@ -1,17 +1,5 @@
|
||||
import { resourceName } from '../config';
|
||||
import { serverReady } from '../database';
|
||||
|
||||
export const scheduleTick = async () => {
|
||||
if (!serverReady) {
|
||||
await new Promise<void>((resolve) => {
|
||||
(function wait() {
|
||||
if (serverReady) {
|
||||
return resolve();
|
||||
}
|
||||
setTimeout(wait);
|
||||
})();
|
||||
});
|
||||
}
|
||||
|
||||
export async function scheduleTick() {
|
||||
ScheduleResourceTick(resourceName);
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user