This commit is contained in:
1 parent
d7b49e2b66
commit
e003c508f3
5 files changed
+181
-138
No files matched your search
@@ -196,9 +196,7 @@ class MqttCore {
|
||||
break;
|
||||
|
||||
case 'job_del':
|
||||
if (!kDebugMode) {
|
||||
_jobDeleteReceived(payloadData);
|
||||
}
|
||||
_jobDeleteReceived(payloadData);
|
||||
break;
|
||||
|
||||
case 'sync_request':
|
||||
@@ -291,12 +289,8 @@ class MqttCore {
|
||||
}
|
||||
}
|
||||
|
||||
void _jobDeleteReceived(List<dynamic> payloadData) async {
|
||||
Map<String, dynamic> map = {};
|
||||
map["jobDel"] = payloadData;
|
||||
var jobDelMessage = JobDelMessage.fromJson(map);
|
||||
|
||||
for(var jobId in jobDelMessage.jobDel) {
|
||||
void _jobDeleteReceived(payloadData) async {
|
||||
for(var jobId in payloadData) {
|
||||
await MyApp.isarInstance.writeTxn(() async {
|
||||
await MyApp.isarInstance.jobs.delete(jobId);
|
||||
});
|
||||
|
||||
+6
-2
@@ -72,12 +72,16 @@ class Util {
|
||||
return currentUuid;
|
||||
}
|
||||
|
||||
static _printLongText(String text) {
|
||||
final pattern = RegExp('.{1,800}'); // 800 is the size of each chunk
|
||||
pattern.allMatches(text).forEach((match) => debugPrint(match.group(0)));
|
||||
}
|
||||
static logInfo(String message) {
|
||||
debugPrint(message);
|
||||
_printLongText(message);
|
||||
}
|
||||
|
||||
static logException(String message) {
|
||||
debugPrint('Exception: $message');
|
||||
_printLongText(message);
|
||||
}
|
||||
|
||||
static int fastHash(String string) {
|
||||
|
||||
Reference in new issue
Block a user