Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CloudSync/Config/GetPhieuDonTiepPubSub.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
"CloudGetUrl": "",
"CloudToken": "",
"Channel": "lichkham/pending",
"Lane": ""
"Lane": "",
"urlCQSNode": ""
}
3 changes: 2 additions & 1 deletion CloudSync/Process/GetKetQuaKCBPubSub.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
return Task.FromResult(true);
}, (subErr) =>
{
if (subErr is Exception)

Check warning on line 42 in CloudSync/Process/GetKetQuaKCBPubSub.cs

View workflow job for this annotation

GitHub Actions / build (8.0.x)

The given expression is never of the provided ('Exception') type

Check warning on line 42 in CloudSync/Process/GetKetQuaKCBPubSub.cs

View workflow job for this annotation

GitHub Actions / build (8.0.x)

The given expression is never of the provided ('Exception') type

Check warning on line 42 in CloudSync/Process/GetKetQuaKCBPubSub.cs

View workflow job for this annotation

GitHub Actions / build (8.0.x)

The given expression is never of the provided ('Exception') type

Check warning on line 42 in CloudSync/Process/GetKetQuaKCBPubSub.cs

View workflow job for this annotation

GitHub Actions / build (8.0.x)

The given expression is never of the provided ('Exception') type

Check warning on line 42 in CloudSync/Process/GetKetQuaKCBPubSub.cs

View workflow job for this annotation

GitHub Actions / build (8.0.x)

The given expression is never of the provided ('Exception') type

Check warning on line 42 in CloudSync/Process/GetKetQuaKCBPubSub.cs

View workflow job for this annotation

GitHub Actions / build (8.0.x)

The given expression is never of the provided ('Exception') type
{
logger.Error("Please check subError!", subErr);
}
Expand Down Expand Up @@ -77,12 +77,13 @@
logger.Info("0.1. Pulling ketqua kcb...");
var authToken = Config.FindValue("CloudToken");
var vLane = Config.GetValue<string>("Lane");
var sNodeCQS = Config.GetValue("urlCQSNode", "");
var apiMethodUrl = $"{apiCloudGetUrl}?msgToken={token}";
if (vLane.IsNotNullOrEmpty())
{
apiMethodUrl += $"&lane={vLane}";
}
var vListResult = await apiMethodUrl.GetAsJson<VMData[]>(authToken);
var vListResult = await apiMethodUrl.GetAsJson<VMData[]>(authToken, sNodeCQS);
if (vListResult != null)
{
logger.Info($"1.1. Pulled new result: data={JsonConvert.SerializeObject(vListResult)}");
Expand Down
8 changes: 5 additions & 3 deletions CloudSync/Process/GetPhieuDonTiepPubSub.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace CloudSync.Process
{
public class GetPhieuDonTiepPubSub: QueueJobProcess<object>
public class GetPhieuDonTiepPubSub : QueueJobProcess<object>
{
private string latestMessageToken = string.Empty;

Expand All @@ -22,8 +22,9 @@
// TODO: Cập nhật cấu hình CloudToken vào file cấu hình Config/GetPhieuDonTiepPubSub.json
var authCloudToken = Config.FindValue("CloudToken");
var subChannel = Config.GetValue("Channel", "lichkham/pending");
var sNodeCQS = Config.GetValue("urlCQSNode", "");
var infoToken = authCloudToken?.Substring(0, 6) ?? "NULL";
if (authCloudToken is null || !PubSubHelper.Initialize(authCloudToken).Wait(10000))
if (authCloudToken is null || !PubSubHelper.Initialize(authCloudToken, sNodeCQS).Wait(10000))
{
logger.Error($"Cannot init Pubsub => Please verify CloudToken, token={infoToken}...");
return;
Expand All @@ -38,7 +39,7 @@
return Task.FromResult(true);
}, (subErr) =>
{
if (subErr is Exception)

Check warning on line 42 in CloudSync/Process/GetPhieuDonTiepPubSub.cs

View workflow job for this annotation

GitHub Actions / build (8.0.x)

The given expression is never of the provided ('Exception') type

Check warning on line 42 in CloudSync/Process/GetPhieuDonTiepPubSub.cs

View workflow job for this annotation

GitHub Actions / build (8.0.x)

The given expression is never of the provided ('Exception') type

Check warning on line 42 in CloudSync/Process/GetPhieuDonTiepPubSub.cs

View workflow job for this annotation

GitHub Actions / build (8.0.x)

The given expression is never of the provided ('Exception') type

Check warning on line 42 in CloudSync/Process/GetPhieuDonTiepPubSub.cs

View workflow job for this annotation

GitHub Actions / build (8.0.x)

The given expression is never of the provided ('Exception') type

Check warning on line 42 in CloudSync/Process/GetPhieuDonTiepPubSub.cs

View workflow job for this annotation

GitHub Actions / build (8.0.x)

The given expression is never of the provided ('Exception') type

Check warning on line 42 in CloudSync/Process/GetPhieuDonTiepPubSub.cs

View workflow job for this annotation

GitHub Actions / build (8.0.x)

The given expression is never of the provided ('Exception') type
{
logger.Error("Please check subError!", subErr);
}
Expand Down Expand Up @@ -76,12 +77,13 @@
logger.Info("0.1. Pulling ketqua phieu don tiep...");
var authToken = Config.FindValue("CloudToken");
var vLane = Config.GetValue<string>("Lane");
var sNodeCQS = Config.GetValue("urlCQSNode", "");
var apiMethodUrl = $"{apiCloudGetUrl}?msgToken={token}";
if (vLane.IsNotNullOrEmpty())
{
apiMethodUrl += $"&lane={vLane}";
}
var vListResult = await apiMethodUrl.GetAsJson<object>(authToken);
var vListResult = await apiMethodUrl.GetAsJson<object>(authToken, sNodeCQS);
if (vListResult != null)
{
logger.Info($"1.1. Pulled new result: data={JsonConvert.SerializeObject(vListResult)}");
Expand Down
Loading