mirror of
https://git.qoto.org/fedipage/fedipage.git
synced 2024-11-15 19:47:57 +01:00
Changed then to await.
This commit is contained in:
parent
87a1458858
commit
bb57253ff0
1 changed files with 6 additions and 6 deletions
|
@ -42,10 +42,10 @@ export default async function (req: VercelRequest, res: VercelResponse) {
|
||||||
let sentIds = [];
|
let sentIds = [];
|
||||||
if ( (!config.exists) || (configData == undefined) ) {
|
if ( (!config.exists) || (configData == undefined) ) {
|
||||||
// Config doesn't exist, make something
|
// Config doesn't exist, make something
|
||||||
configRef.set({
|
await configRef.set({
|
||||||
"sentIds": [],
|
"sentIds": [],
|
||||||
"lastEpoch": ""
|
"lastEpoch": ""
|
||||||
}).then(result => response.status(200));
|
});
|
||||||
} else {
|
} else {
|
||||||
if( configData.sentIds.length > 0 ) {
|
if( configData.sentIds.length > 0 ) {
|
||||||
sentIds.push(...configData.sentIds);
|
sentIds.push(...configData.sentIds);
|
||||||
|
@ -59,10 +59,10 @@ export default async function (req: VercelRequest, res: VercelResponse) {
|
||||||
res.status(401).end("Function is rate limited, please wait")
|
res.status(401).end("Function is rate limited, please wait")
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
configRef.set({
|
await configRef.set({
|
||||||
"sentIds": sentIds,
|
"sentIds": sentIds,
|
||||||
"lastEpoch": new Date().getTime()
|
"lastEpoch": new Date().getTime()
|
||||||
}).then(result => response.status(200));
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -119,10 +119,10 @@ export default async function (req: VercelRequest, res: VercelResponse) {
|
||||||
if( sendingIds.size > 0 ) {
|
if( sendingIds.size > 0 ) {
|
||||||
newSentIds.push(...sendingIds);
|
newSentIds.push(...sendingIds);
|
||||||
}
|
}
|
||||||
configRef.set({
|
await configRef.set({
|
||||||
"sentIds": newSentIds,
|
"sentIds": newSentIds,
|
||||||
"lastEpoch": new Date().getTime()
|
"lastEpoch": new Date().getTime()
|
||||||
}).then(result => response.status(200));
|
});
|
||||||
|
|
||||||
console.log("sendNode successful", sentIds, sendingIds, newSentIds);
|
console.log("sendNode successful", sentIds, sendingIds, newSentIds);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue