Skip to content
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

Change update rate of snapshots sent to the server #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion src/components/middle/immedia/Immedia.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ const Immedia: FC<OwnProps & StateProps> = ({ chatId, currentUser }) => {

useInterval(() => {
sendUpdate();
}, awareness && connected && userId ? UPDATE_RATE : undefined);
}, awareness && connected && userId && lastSnapshot ? UPDATE_RATE : undefined);

// TODO: Define the Heartbeat function to keep track user connection.
// Keep Track of connection status
Expand Down
2 changes: 1 addition & 1 deletion src/components/middle/immedia/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const GC_RATE = 1500; // 1.5 seconds
const REMOVE_THRESHOLD = 1000 * 20; // 20 seconds
const SNAPSHOT_RATE = 500; // 0.5 seconds
const PING_RATE = 1000 * 5; // 5 seconds
const UPDATE_RATE = 1000 * 1; // 1 second
const UPDATE_RATE = 500 * 1; // 0.5 seconds

export { WEBSOCKET_URL };
export { INIT };
Expand Down