Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
coco
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
coco
Commits
def3ad94
Commit
def3ad94
authored
Jan 02, 2018
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Bugfix] session添加时区
parent
e2149c5c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
session.py
coco/session.py
+5
-4
No files found.
coco/session.py
View file @
def3ad94
...
...
@@ -5,6 +5,7 @@ import threading
import
uuid
import
logging
import
datetime
import
time
import
selectors
import
time
...
...
@@ -20,7 +21,7 @@ class Session:
self
.
_watchers
=
[]
# Only watch session
self
.
_sharers
=
[]
# Join to the session, read and write
self
.
replaying
=
True
self
.
date_created
=
datetime
.
datetime
.
now
()
self
.
date_created
=
datetime
.
datetime
.
utc
now
()
self
.
date_end
=
None
self
.
stop_evt
=
threading
.
Event
()
self
.
sel
=
selectors
.
DefaultSelector
()
...
...
@@ -160,7 +161,7 @@ class Session:
logger
.
info
(
"Close the session: {} "
.
format
(
self
.
id
))
self
.
stop_evt
.
set
()
self
.
post_bridge
()
self
.
date_end
=
datetime
.
datetime
.
now
()
self
.
date_end
=
datetime
.
datetime
.
utc
now
()
self
.
server
.
close
()
def
to_json
(
self
):
...
...
@@ -171,8 +172,8 @@ class Session:
"system_user"
:
self
.
server
.
system_user
.
username
,
"login_from"
:
"ST"
,
"is_finished"
:
True
if
self
.
stop_evt
.
is_set
()
else
False
,
"date_start"
:
self
.
date_created
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
),
"date_end"
:
self
.
date_end
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
)
if
self
.
date_end
else
None
"date_start"
:
self
.
date_created
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
)
+
" +0000"
,
"date_end"
:
self
.
date_end
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
)
+
" +0000"
if
self
.
date_end
else
None
}
def
__str__
(
self
):
...
...
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