|
@@ -1,6 +1,6 @@
|
|
|
import { stat } from "fs";
|
|
|
import { resolve } from "path";
|
|
|
-import { Observable, map, Subject, takeUntil, take, of, timer } from "rxjs";
|
|
|
+import { Observable, map, Subject, takeUntil, take, of, timer, from } from "rxjs";
|
|
|
import { BaseMessage } from "../dependencies/fisappmessagejsutilty/dependencies/dependencies";
|
|
|
import { LogSetting, MessageLog } from "../dependencies/fisloggingservice/type/datatype";
|
|
|
import { AcknowledgementService } from "../services/acknowledgement.service";
|
|
@@ -117,19 +117,29 @@ const triggerSync = timer(5000).pipe(map(
|
|
|
/* -------- SYNCHRONIZATION --------- */
|
|
|
function initializeData() {
|
|
|
source_incoming.init(source_dataSet)
|
|
|
- target_incoming.init(target_dataSet)
|
|
|
- setTimeout(() => {
|
|
|
- }, 4500)
|
|
|
+ target_incoming.init(target_dataSet)
|
|
|
}
|
|
|
|
|
|
+// Done by 4 seconds
|
|
|
initializeData()
|
|
|
-
|
|
|
source_synchronize.init(settings)
|
|
|
-let sync = source_synchronize.subscribe(triggerSync)
|
|
|
-sync.subscribe({
|
|
|
- next: (msgToBeSynched) => {
|
|
|
- // console.log(`synching ... ${msgToBeSynched.header.messageID}`)
|
|
|
- target_payload_subject.next(msgToBeSynched)
|
|
|
- }
|
|
|
-})
|
|
|
|
|
|
+// by 5th second
|
|
|
+setTimeout(() => {
|
|
|
+
|
|
|
+ let triggerSync = from(['Newsynch'])
|
|
|
+
|
|
|
+ let sync = source_synchronize.subscribe(triggerSync)
|
|
|
+ sync.subscribe({
|
|
|
+ next: (msgToBeSynched) => {
|
|
|
+ // console.log(`synching ... ${msgToBeSynched.header.messageID}`)
|
|
|
+ target_payload_subject.next(msgToBeSynched)
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+}, 30000)//30s
|
|
|
+
|
|
|
+// To DO
|
|
|
+// more test files
|
|
|
+// synch an additional source message at runtime(after 30sec)
|
|
|
+// more comments to be more readable
|