Skip to content

Commit

Permalink
Removed JobId columns (#364)
Browse files Browse the repository at this point in the history
* Removed JobId columns in the tables: ChannelOperationRequest, Nodes, WalletWithdrawalRequest.

* Update src/Pages/Nodes.razor

Co-authored-by: Rodrigo <[email protected]>

---------

Co-authored-by: Rodrigo <[email protected]>
  • Loading branch information
AleksKSoftware and RodriFS committed Feb 1, 2024
1 parent fb7a48c commit b164516
Show file tree
Hide file tree
Showing 14 changed files with 1,332 additions and 50 deletions.
5 changes: 0 additions & 5 deletions src/Data/Models/ChannelOperationRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,6 @@ public decimal Amount
[NotMapped]
public int NumberOfSignaturesCollected => ChannelOperationRequestPsbts == null ? 0 : ChannelOperationRequestPsbts.Count(x => !x.IsFinalisedPSBT && !x.IsTemplatePSBT && !x.IsInternalWalletPSBT);

/// <summary>
/// This is the JobId provided by Quartz of the job executing this request.
/// </summary>
public string? JobId { get; set; }

/// <summary>
/// This indicates if the user requested a changeless operation by selecting UTXOs
/// </summary>
Expand Down
5 changes: 0 additions & 5 deletions src/Data/Models/Node.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,6 @@ public class Node : Entity
public ICollection<ChannelOperationRequest> ChannelOperationRequestsAsDestination { get; set; }

public ICollection<ApplicationUser> Users { get; set; }

/// <summary>
/// This is the JobId provided by Quartz of the job running the subscription to get the info of the node.
/// </summary>
public string? JobId { get; set; }

#endregion Relationships
}
Expand Down
5 changes: 0 additions & 5 deletions src/Data/Models/WalletWithdrawalRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,6 @@ public class WalletWithdrawalRequest : Entity, IEquatable<WalletWithdrawalReques
: WalletWithdrawalRequestPSBTs.Count(x =>
!x.IsTemplatePSBT && !x.IsFinalisedPSBT && !x.IsInternalWalletPSBT);

/// <summary>
/// This is the JobId provided by Quartz of the job executing this request.
/// </summary>
public string? JobId { get; set; }

/// <summary>
/// This indicates if the user requested a changeless operation by selecting UTXOs
/// </summary>
Expand Down
3 changes: 0 additions & 3 deletions src/Data/Repositories/ChannelRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,6 @@ public async Task<List<Channel>> GetAll()
var job = RetriableJob.Create<ChannelCloseJob>(map, closeRequest.Id.ToString(), retryList);
await scheduler.ScheduleJob(job.Job, job.Trigger);

// TODO: Check job id
closeRequest.JobId = job.Job.Key.ToString();

var jobUpdateResult = _channelOperationRequestRepository.Update(closeRequest);
if (!jobUpdateResult.Item1)
{
Expand Down
4 changes: 1 addition & 3 deletions src/Jobs/MonitorChannelsJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,10 @@ public async Task Execute(IJobExecutionContext context)
var job = SimpleJob.Create<ChannelMonitorJob>(map, managedNode.Id.ToString());
await scheduler.ScheduleJob(job.Job, job.Trigger);

var jobId = job.Job.Key.ToString();
managedNode.JobId = jobId;
var jobUpateResult = _nodeRepository.Update(managedNode);
if (!jobUpateResult.Item1)
{
_logger.LogWarning("Couldn't update Node {NodeId} with JobId {JobId}", managedNode.Id, jobId);
_logger.LogWarning("Couldn't update Node {NodeId}", managedNode.Id);
}
}
}
Expand Down
1 change: 0 additions & 1 deletion src/Jobs/NodeSubscriptorJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ public async Task Execute(IJobExecutionContext context)
var job = SimpleJob.Create<NodeChannelSuscribeJob>(map, managedNode.Id.ToString());
await scheduler.ScheduleJob(job.Job, job.Trigger);

managedNode.JobId = job.Job.Key.ToString();
var jobUpateResult = _nodeRepository.Update(managedNode);
}
}
Expand Down
Loading

0 comments on commit b164516

Please sign in to comment.