8000 Remove sync trigger when connecting by aurelticot · Pull Request #503 · verida/vault-web · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Remove sync trigger when connecting #503

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
import { useQueryClient } from "@tanstack/react-query"
import { useEffect } from "react"

import { DATA_CONNECTIONS_SYNC_INTERVAL } from "@/features/data-connections/constants"
import { prefetchDataProviders } from "@/features/data-connections/hooks/use-data-providers"
import { useSyncAllDataConnections } from "@/features/data-connections/hooks/use-sync-all-data-connections"
import { Logger } from "@/features/telemetry/logger"

const logger = Logger.create("data-connections")
Expand All @@ -30,20 +28,6 @@ export function DataConnectionsProvider(props: DataConnectionsProviderProps) {
})
}, [queryClient])

// Sync all connections
const { syncAllConnections } = useSyncAllDataConnections()
useEffect(() => {
// Sync at startup
syncAllConnections()

// Sync at regular intervals
const interval = setInterval(() => {
syncAllConnections()
}, DATA_CONNECTIONS_SYNC_INTERVAL)

return () => clearInterval(interval)
}, [syncAllConnections])

return <>{children}</>
}
DataConnectionsProvider.displayName = "DataConnectionsProvider"
2 changes: 0 additions & 2 deletions src/features/data-connections/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ export const DEFAULT_DATA_PROVIDER_DESCRIPTION = `Connect your account to extrac

export const DATA_CONNECTIONS_CHANNEL = "data-connections"

export const DATA_CONNECTIONS_SYNC_INTERVAL = 1000 * 60 * 30 // 30 minutes

export const DATA_CONNECTIONS_LOGS_DB_DEF: DatabaseDefinition = {
id: "data-connections-logs",
type: "technical",
Expand Down
0