File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed
Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -166,6 +166,11 @@ export class NotesConnection {
166166 }
167167 }
168168 } )
169+
170+ {
171+ const pollstate = await this . getPollinfo ( purenotes )
172+ if ( pollstate ) socket . emit ( pollstate . command , pollstate . data )
173+ }
169174 }
170175
171176 async getNotesToken ( oldtoken ) {
@@ -296,7 +301,7 @@ export class NotesConnection {
296301 const boardnum = res [ index ]
297302 // console.log('sendBoardsToSocket', boardnum, lectureuuid)
298303 try {
299- const res2 = await this . redis . getBuffer (
304+ const res2 = await this . redis . get (
300305 commandOptions ( { returnBuffers : true } ) ,
301306 'lecture:' + lectureuuid + ':board' + boardnum
302307 )
@@ -337,6 +342,20 @@ export class NotesConnection {
337342 }
338343 }
339344
345+ async getPollinfo ( args ) {
346+ try {
347+ const pollinfo = await this . redis . hGetAll (
348+ 'lecture:' + args . lectureuuid + ':pollstate'
349+ )
350+ if ( pollinfo . command && pollinfo . data )
351+ return { command : pollinfo . command , data : JSON . parse ( pollinfo . data ) }
352+ else return null
353+ } catch ( error ) {
354+ console . log ( 'getPollInfo failed' , error )
355+ return null
356+ }
357+ }
358+
340359 getRoomName ( uuid ) {
341360 return uuid
342361 }
You can’t perform that action at this time.
0 commit comments