Add information about populating LocationManager

This commit is contained in:
Aelita4 2024-09-25 13:47:15 +02:00
parent 503e8e34dd
commit ceefef38df
Signed by: Aelita4
GPG Key ID: E44490C2025906C1
1 changed files with 4 additions and 0 deletions

View File

@ -49,6 +49,8 @@ class LocationManager {
this.users.push(new User(user._id, user.username, user.email, user.createdAt, user.updatedAt, user.lastLogin)); this.users.push(new User(user._id, user.username, user.email, user.createdAt, user.updatedAt, user.lastLogin));
}); });
console.log(`Loaded ${users.length} users from database`);
const galaxies = await getAllGalaxies(); const galaxies = await getAllGalaxies();
for(const galaxy of galaxies) { for(const galaxy of galaxies) {
const galaxyObject: Galaxy = { const galaxyObject: Galaxy = {
@ -93,6 +95,8 @@ class LocationManager {
this.galaxies.push(galaxyObject); this.galaxies.push(galaxyObject);
}; };
console.log(`Loaded ${this.galaxies.length} galaxies from database`);
for(const user of this.users) { for(const user of this.users) {
await user.init(); await user.init();
const userDB = users.find(u => u._id.equals(user.id)); const userDB = users.find(u => u._id.equals(user.id));