mirror of
https://github.com/Nezumi-2711/javascript-training.git
synced 2026-09-23 04:09:58 +00:00
Add time out connect for getDataFromId function
This commit is contained in:
@@ -30,7 +30,8 @@ export default class CommonService {
|
|||||||
|
|
||||||
async getDataFromId(id, path = this.defaultPath) {
|
async getDataFromId(id, path = this.defaultPath) {
|
||||||
this.connectToDb();
|
this.connectToDb();
|
||||||
const data = await this.firebaseService.getDataFromId(id, path);
|
const result = await this.firebaseService.getDataFromId(id, path);
|
||||||
|
const data = await timeOutConnect(result);
|
||||||
if (data) return data;
|
if (data) return data;
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user