@@ -220,36 +220,3 @@ func (m *Manager) refreshTimer(username string) error {
220220
221221 return nil
222222}
223-
224- /* TODO: toDashoardView must be changed to fetch data from Redis only */
225-
226- /* convert session information into frontend safe structure */
227- func (m * Manager ) toDashboardView (username string ) (SessionView , error ) {
228- /* thread safety for the manager */
229- m .mutex .Lock ()
230- defer m .mutex .Unlock ()
231-
232- /* get session from sessionMap */
233- session , exists := m .sessionsMap [username ]
234- if ! exists {
235- return SessionView {}, fmt .Errorf ("session not found" )
236- }
237-
238- /* thread safety for the session */
239- session .Mutex .Lock ()
240- defer session .Mutex .Unlock ()
241-
242- /* can be directly served as JSON in handler */
243- return SessionView {
244- ID : session .ID .String (),
245- Username : session .Username ,
246- IP : session .IP ,
247- UserAgent : session .UserAgent ,
248- CreatedAt : session .CreatedAt ,
249- LastActiveAt : session .LastActiveAt ,
250- Expiry : session .Expiry ,
251- CompletedCount : session .CompletedCount ,
252- FailedCount : session .FailedCount ,
253- PendingCount : session .TransactionQueue .Len (),
254- }, nil
255- }
0 commit comments