mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-04-27 09:18:28 -04:00
api/stats: get database and RSS results asynchronously (a LOT faster)
This commit is contained in:
parent
906fbedc15
commit
7a5962fa7e
@ -36,13 +36,16 @@ exports.handler = async (event) => {
|
||||
secret: process.env.FAUNADB_SERVER_SECRET,
|
||||
});
|
||||
|
||||
const feed = await parser.parseURL(baseUrl + "feed.xml");
|
||||
const result = await client.query(
|
||||
// get database and RSS results asynchronously
|
||||
const [feed, result] = await Promise.all([
|
||||
parser.parseURL(baseUrl + "feed.xml"),
|
||||
client.query(
|
||||
q.Map(
|
||||
q.Paginate(q.Documents(q.Collection("hits"))),
|
||||
q.Lambda((x) => q.Select("data", q.Get(x)))
|
||||
)
|
||||
);
|
||||
),
|
||||
]);
|
||||
|
||||
let stats = {
|
||||
total: {
|
||||
|
Loading…
x
Reference in New Issue
Block a user