Bug Fix & Improvements

- Improve logs
- Fix fetch message not working
This commit is contained in:
Linloir 2022-10-20 10:44:09 +08:00
parent 0aa72b5dc3
commit 5909308475
No known key found for this signature in database
GPG Key ID: 58EEB209A0F2C366
2 changed files with 11 additions and 4 deletions

View File

@ -1,7 +1,7 @@
/* /*
* @Author : Linloir * @Author : Linloir
* @Date : 2022-10-06 15:44:16 * @Date : 2022-10-06 15:44:16
* @LastEditTime : 2022-10-19 14:41:56 * @LastEditTime : 2022-10-20 01:00:24
* @Description : * @Description :
*/ */
@ -121,9 +121,15 @@ void main(List<String> arguments) async {
); );
for(var controller in targetControllers) { for(var controller in targetControllers) {
try { try {
print('[L] [MSGFOWARD]-----------------------');
print('[L] Forwarding message to ${controller.socket.remoteAddress}:${controller.socket.remotePort}');
controller.outStream.add(forwardResponse); controller.outStream.add(forwardResponse);
} catch(e) { } catch(e) {
print(e); print('[E] [EXCEPTION]-----------------------');
var token = controllerMap[controller];
controllerMap.remove(controller);
tokenMap[token]?.remove(controller);
continue;
} }
} }
//Update Fetch Histories //Update Fetch Histories
@ -153,6 +159,7 @@ void main(List<String> arguments) async {
var token = controllerMap[controller]; var token = controllerMap[controller];
controllerMap.remove(controller); controllerMap.remove(controller);
tokenMap[token]?.remove(controller); tokenMap[token]?.remove(controller);
continue;
} }
} }
//Update Fetch Histories //Update Fetch Histories

View File

@ -1,7 +1,7 @@
/* /*
* @Author : Linloir * @Author : Linloir
* @Date : 2022-10-06 16:15:01 * @Date : 2022-10-06 16:15:01
* @LastEditTime : 2022-10-18 14:12:22 * @LastEditTime : 2022-10-20 10:40:50
* @Description : * @Description :
*/ */
@ -358,7 +358,7 @@ class DataBaseHelper {
//Fetch unfetched messages //Fetch unfetched messages
var unfetchMsgQueryResult = await _database.query( var unfetchMsgQueryResult = await _database.query(
'msgs join msgfiles on msgs.md5encoded = msgfiles.msgmd5', 'msgs left outer join msgfiles on msgs.md5encoded = msgfiles.msgmd5',
columns: [ columns: [
'msgs.userid as userid', 'msgs.userid as userid',
'msgs.targetid as targetid', 'msgs.targetid as targetid',