Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
performance
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zry
performance
Commits
0fc6f779
Commit
0fc6f779
authored
Mar 04, 2021
by
lcx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
c9cdca5e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
performance/Performance.Services/Hubs/AllotLogHub.cs
+8
-5
No files found.
performance/Performance.Services/Hubs/AllotLogHub.cs
View file @
0fc6f779
...
...
@@ -29,18 +29,21 @@ NotificationsService service
private
readonly
MemoryCacheHelper
helper
=
new
MemoryCacheHelper
();
public
void
LoginService
(
int
userId
)
public
void
LoginService
(
string
userId
)
{
if
(
helper
.
Exists
(
userId
))
helper
.
Remove
(
userId
);
var
dateTime
=
DateTime
.
Now
;
var
slidingtimespan
=
helper
.
ToUnixTimestampBySeconds
(
dateTime
.
AddMinutes
(
30
));
var
absolutetimespan
=
helper
.
ToUnixTimestampBySeconds
(
dateTime
.
AddHours
(
2
));
helper
.
Set
(
userId
.
ToString
()
,
Context
.
ConnectionId
,
slidingtimespan
,
absolutetimespan
);
helper
.
Set
(
userId
,
Context
.
ConnectionId
,
slidingtimespan
,
absolutetimespan
);
}
public
void
LogoutService
(
int
userId
)
public
void
LogoutService
(
string
userId
)
{
if
(
helper
.
Exists
(
userId
.
ToString
()
))
helper
.
Remove
(
userId
.
ToString
()
);
if
(
helper
.
Exists
(
userId
))
helper
.
Remove
(
userId
);
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment