Skip to content

Commit

Permalink
tidy up code
Browse files Browse the repository at this point in the history
  • Loading branch information
JFriel committed Jul 17, 2024
1 parent 0539bae commit 9a56cc9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 30 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dotnet-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v4
with:
repository: HicServices/RDMP
ref: v8.2.0
ref: develop
path: RDMP
- uses: actions/setup-dotnet@v4
with:
Expand Down
29 changes: 0 additions & 29 deletions SCIStorePlugin/Attachers/SciStoreAttacher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,23 +108,9 @@ public override ExitCodeType Attach(IDataLoadJob job, GracefulCancellationToken
$"{destRepo.ResultsTable.Rows.Count} rows added to Results Data Table"));

// this repo uses DataTables, so next need to batch insert the table data into the DB
job.OnNotify(this, new NotifyEventArgs(ProgressEventType.Information, "SciStoreAttacher::Starting to insert headers"));

BulkInsertDataTable(destRepo.HeadersTable, job);

job.OnNotify(this, new NotifyEventArgs(ProgressEventType.Information, "SciStoreAttacher::Completed inserting headers"));
job.OnNotify(this, new NotifyEventArgs(ProgressEventType.Information, "SciStoreAttacher::Starting to insert sample details"));

BulkInsertDataTable(destRepo.SampleDetailsTable, job);

job.OnNotify(this, new NotifyEventArgs(ProgressEventType.Information, "SciStoreAttacher::Completed inserting sample details"));
job.OnNotify(this, new NotifyEventArgs(ProgressEventType.Information, "SciStoreAttacher::Starting to insert results"));

BulkInsertDataTable(destRepo.ResultsTable, job);

job.OnNotify(this, new NotifyEventArgs(ProgressEventType.Information, "SciStoreAttacher::Completed inserting results"));


_timer.Stop();

job.OnNotify(this, new NotifyEventArgs(ProgressEventType.Information, "SciStoreAttacher::Attach complete"));
Expand All @@ -146,21 +132,6 @@ private void BulkInsertDataTable(DataTable dataTable, IDataLoadJob job)

var tbl = _dbInfo.ExpectTable(dataTable.TableName);
using var blk = tbl.BeginBulkInsert();
//DataTable ndt = dataTable.Clone();
//foreach (var row in dataTable.Rows)
//{
// try
// {
// ndt = dataTable.Clone();
// ndt.Rows.Add(row);
// blk.Upload(ndt);
// }
// catch (Exception e)
// {
// job.OnNotify(this, new NotifyEventArgs(ProgressEventType.Warning,
// $"Skipped a row due to error: {e.Message}.", e));
// }
//}
blk.Upload(dataTable);
}

Expand Down

0 comments on commit 9a56cc9

Please sign in to comment.