Skip to content

Commit

Permalink
returned a different error code when row count test fail
Browse files Browse the repository at this point in the history
  • Loading branch information
yorek committed Aug 19, 2019
1 parent 41bce95 commit cedeb09
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions SmartBulkCopy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -208,16 +208,18 @@ public async Task<int> Copy(List<String> tablesToCopy)
monitorTask.Wait();

_logger.Info("Checking source and destination row counts...");
bool result = await CheckResults();
bool rowsChecked = await CheckResults();
int result = 0 ;

if (!result)
if (!rowsChecked)
{
_logger.Warn("WARNING! Source and Destination table have a different number of rows!");
result = 2;
}

_logger.Info("Done in {0:#.00} secs.", (double)_stopwatch.ElapsedMilliseconds / 1000.0);

return 0;
return result;
}

private bool CheckTableSize(string tableName)
Expand Down

0 comments on commit cedeb09

Please sign in to comment.