mirror of
https://github.com/supabase/supabase.git
synced 2026-10-06 18:05:11 +03:00
fix: restrict how many requests are made by app to api when no sql is present for logs request
This commit is contained in:
1 parent
0e88f9f1a7
commit
a4eb67cdba
1 file changed
+7
@@ -61,6 +61,13 @@ function useLogsPreview(
|
||||
// handle url generation for log pagination
|
||||
const getKeyLogs: SWRInfiniteKeyLoader = (_pageIndex: number, prevPageData: Logs) => {
|
||||
let queryParams
|
||||
|
||||
// check that SQL is ready for the logs request
|
||||
if(!params.sql || !params.rawSql) {
|
||||
// return empty url to restrict unnecessary requests to api
|
||||
return ''
|
||||
}
|
||||
|
||||
// if prev page data is 100 items, could possibly have more records that are not yet fetched within this interval
|
||||
if (prevPageData === null) {
|
||||
// reduce interval window limit by using the timestamp of the last log
|
||||
|
||||
Reference in new issue
Block a user