File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ export const handler = async (event: WebSocketEvent) => {
8484 ) ;
8585 // console.log(`Result: ${JSON.stringify(result)}`);
8686
87- const conns = await getConnections ( ) ;
87+ const conns = await getConnections ( true ) ;
8888 await wsBroadcast ( "connections" , conns ) ;
8989
9090 return { statusCode : 200 } ;
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ const unmarshallOptions = {
1818const translateConfig = { marshallOptions, unmarshallOptions } ;
1919const ddbDocClient = DynamoDBDocumentClient . from ( clnt , translateConfig ) ;
2020
21- export async function getConnections ( ) : Promise < {
21+ export async function getConnections ( consistent = false ) : Promise < {
2222 totalCount : number ;
2323 visibleUserIds : string [ ] ;
2424} > {
@@ -36,6 +36,7 @@ export async function getConnections(): Promise<{
3636 // Only fetch what we need
3737 ProjectionExpression : "userId, invisible" ,
3838 ExclusiveStartKey : lastKey ,
39+ ConsistentRead : consistent ,
3940 } ;
4041
4142 const result = await ddbDocClient . send ( new QueryCommand ( params ) ) ;
You can’t perform that action at this time.
0 commit comments