File tree Expand file tree Collapse file tree 3 files changed +16
-11
lines changed Expand file tree Collapse file tree 3 files changed +16
-11
lines changed Original file line number Diff line number Diff line change 10
10
- uses : actions/checkout@v2
11
11
- uses : actions/setup-python@v1
12
12
with :
13
- python-version : 3.8
13
+ python-version : 3.9
14
14
- name : Install dependencies
15
15
run : |
16
16
python -m pip install --upgrade pip
36
36
- uses : actions/checkout@v2
37
37
- uses : actions/setup-python@v1
38
38
with :
39
- python-version : 3.8
39
+ python-version : 3.9
40
40
- name : Install dependencies
41
41
run : |
42
42
python -m pip install --upgrade pip
57
57
- name : Set up Python
58
58
uses : actions/setup-python@v1
59
59
with :
60
- python-version : 3.8
60
+ python-version : 3.9
61
61
- name : Install dependencies
62
62
run : |
63
63
python -m pip install --upgrade pip
75
75
- uses : actions/setup-node@v3
76
76
with :
77
77
node-version : 16
78
- - name : Building Wechaty-ui
78
+ - name : Building Wechaty-ui
79
79
id : build-ui
80
80
run : |
81
81
make ui
Original file line number Diff line number Diff line change @@ -293,13 +293,18 @@ def load(cls, room_id: str) -> Room:
293
293
return room
294
294
295
295
@classmethod
296
- def upload_cache (cls , room_id : str )-> None :
296
+ def upload_cache (cls , room_id : str ) -> Room :
297
297
"""
298
298
dynamic upload
299
- clear the room_id of _pool and upload it use load
299
+ clear the room_id from _pool and re-upload it using load
300
+ Args:
301
+ room_id: The Roo ID to refresh
302
+ Return:
303
+ Room:The refreshed room instance
300
304
"""
301
- cls ._pool [room_id ] = None
302
- cls .load (room_id )
305
+ if room_id in cls ._pool :
306
+ del cls ._pool [room_id ]
307
+ return cls .load (room_id )
303
308
304
309
def __str__ (self ) -> str :
305
310
"""
Original file line number Diff line number Diff line change 99
99
100
100
from wechaty .utils import timestamp_to_date , qr_terminal
101
101
102
-
103
102
log : logging .Logger = get_logger ('Wechaty' )
104
103
105
104
DEFAULT_TIMEOUT = 300
@@ -472,7 +471,7 @@ async def start(self) -> None:
472
471
loop = asyncio .get_event_loop ()
473
472
loop .stop ()
474
473
475
- except Exception as e : # pylint: disable=broad-except
474
+ except Exception as e : # pylint: disable=broad-except
476
475
print (e )
477
476
478
477
async def restart (self ) -> None :
@@ -713,7 +712,8 @@ async def room_leave_listener(payload: EventRoomLeavePayload) -> None:
713
712
async def room_topic_listener (payload : EventRoomTopicPayload ) -> None :
714
713
log .info ('receive <room-topic> event <%s>' , payload )
715
714
716
- room : Room = self .Room .upload_cache (payload .room_id )
715
+ self .Room .upload_cache (payload .room_id )
716
+ room : Room = self .Room .load (payload .room_id )
717
717
await room .ready ()
718
718
719
719
changer = self .Contact .load (payload .changer_id )
You can’t perform that action at this time.
0 commit comments