You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Source/QiscusCore/Database/CommentStorage.swift
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ class CommentStorage : QiscusStorage {
26
26
27
27
func loadData(){
28
28
self.data =self.loadFromLocal()
29
-
QiscusCore.eventdelegate?.onDebugEvent("InitQiscus-LoadData()", message:"finish loadData() comment \(QiscusLogger.getDateTime()) with data comment count \(self.data.count)")
29
+
QiscusCore.eventdelegate?.onDebugEvent("InitQiscus-LoadData()", message:"finish loadData() comment loadFromLocal() with data comment count \(self.data.count)\(QiscusLogger.getDateTime())")
Copy file name to clipboardExpand all lines: Source/QiscusCore/Database/MemberDatabase.swift
+4-6Lines changed: 4 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -17,8 +17,8 @@ class MemberDatabase {
17
17
}
18
18
19
19
func loadData(){
20
-
self.data =loadFromLocal()
21
-
QiscusCore.eventdelegate?.onDebugEvent("InitQiscus-LoadData()", message:"finish loadData() member \(QiscusLogger.getDateTime()) with data member count \(self.data.count)")
20
+
self.data =self.loadFromLocal()
21
+
QiscusCore.eventdelegate?.onDebugEvent("InitQiscus-LoadData()", message:"finish loadData() member loadFromLocal() with data member count \(self.data.count)\(QiscusLogger.getDateTime())")
22
22
}
23
23
24
24
func removeAll(){
@@ -125,7 +125,7 @@ extension MemberDatabase {
125
125
}else{
126
126
result =Member.generate() // prepare create new
127
127
}
128
-
QiscusThread.background{
128
+
//QiscusThread.background {
129
129
result.id = core.id
130
130
result.avatarUrl = core.avatarUrl?.absoluteString
131
131
result.email = core.email
@@ -136,7 +136,7 @@ extension MemberDatabase {
136
136
iflet extras = core.extras {
137
137
result.extras = extras.dict2json()
138
138
}
139
-
}
139
+
//}
140
140
return result
141
141
}
142
142
@@ -147,7 +147,6 @@ extension MemberDatabase {
147
147
guardlet name = member.username else{return result }
148
148
guardlet email = member.email else{return result }
149
149
guardlet avatarUrl = member.avatarUrl else{return result }
Copy file name to clipboardExpand all lines: Source/QiscusCore/Database/QiscusDatabase/Model/Comment+CoreDataClass.swift
+13Lines changed: 13 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -25,6 +25,12 @@ protocol ActiveRecord {
25
25
extensionComment{
26
26
// create behaviour like active record
27
27
staticfunc all()->[Comment]{
28
+
ifThread.isMainThread {
29
+
QiscusCore.eventdelegate?.onDebugEvent("InitQiscus-loadData()", message:"start load comment.ALL() with running in main thread with time \(QiscusLogger.getDateTime())")
30
+
}else{
31
+
QiscusCore.eventdelegate?.onDebugEvent("InitQiscus-loadData()", message:"start load comment.ALL() with running in background thread with time \(QiscusLogger.getDateTime())")
QiscusCore.eventdelegate?.onDebugEvent("InitQiscus-loadData()", message:"finish load room.ALL() with running in main thread with time \(QiscusLogger.getDateTime())")
57
+
}else{
58
+
QiscusCore.eventdelegate?.onDebugEvent("InitQiscus-loadData()", message:"finish load room.ALL() with running in background thread with time \(QiscusLogger.getDateTime())")
Copy file name to clipboardExpand all lines: Source/QiscusCore/Database/QiscusDatabase/Model/Member+CoreDataClass.swift
+13Lines changed: 13 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -17,6 +17,12 @@ public class Member: NSManagedObject {
17
17
extensionMember{
18
18
// create behaviour like active record
19
19
staticfunc all()->[Member]{
20
+
ifThread.isMainThread {
21
+
QiscusCore.eventdelegate?.onDebugEvent("InitQiscus-loadData()", message:"start load member.ALL() with running in main thread with time \(QiscusLogger.getDateTime())")
22
+
}else{
23
+
QiscusCore.eventdelegate?.onDebugEvent("InitQiscus-loadData()", message:"start load member.ALL() with running in background thread with time \(QiscusLogger.getDateTime())")
QiscusCore.eventdelegate?.onDebugEvent("InitQiscus-loadData()", message:"finish load member.ALL() with running in main thread with time \(QiscusLogger.getDateTime())")
47
+
}else{
48
+
QiscusCore.eventdelegate?.onDebugEvent("InitQiscus-loadData()", message:"finish load member.ALL() with running in background thread with time \(QiscusLogger.getDateTime())")
Copy file name to clipboardExpand all lines: Source/QiscusCore/Database/QiscusDatabase/Model/Room+CoreDataClass.swift
+15Lines changed: 15 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -18,11 +18,19 @@ public class Room: NSManagedObject {
18
18
extensionRoom{
19
19
// create behaviour like active record
20
20
staticfunc all()->[Room]{
21
+
ifThread.isMainThread {
22
+
QiscusCore.eventdelegate?.onDebugEvent("InitQiscus-loadData()", message:"start load room.ALL() with running in main thread with time \(QiscusLogger.getDateTime())")
23
+
}else{
24
+
QiscusCore.eventdelegate?.onDebugEvent("InitQiscus-loadData()", message:"start load room.ALL() with running in background thread with time \(QiscusLogger.getDateTime())")
QiscusCore.eventdelegate?.onDebugEvent("InitQiscus-loadData()", message:"finish load room.ALL() with running in main thread with time \(QiscusLogger.getDateTime())")
53
+
}else{
54
+
QiscusCore.eventdelegate?.onDebugEvent("InitQiscus-loadData()", message:"finish load room.ALL() with running in background thread with time \(QiscusLogger.getDateTime())")
Copy file name to clipboardExpand all lines: Source/QiscusCore/Database/RoomStorage.swift
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -20,10 +20,10 @@ class RoomStorage {
20
20
}
21
21
22
22
func loadData(){
23
-
letlocal=loadFromLocal()
24
-
data =sort(local)
23
+
letlocal=self.loadFromLocal()
24
+
self.data =self.sort(local)
25
25
26
-
QiscusCore.eventdelegate?.onDebugEvent("InitQiscus-LoadData()", message:"finish loadData() room \(QiscusLogger.getDateTime()) with data room count \(data.count)")
26
+
QiscusCore.eventdelegate?.onDebugEvent("InitQiscus-LoadData()", message:"finish loadData() room loadFromLocal() with data room count \(self.data.count)\(QiscusLogger.getDateTime())")
0 commit comments