Let say that we have a series of function that needs to execute in a loop.
- Get Setttings return
networkPath&localPath. - Copy File from
networkPath(from process 1) to anotherlocalPath. - Read file from
localPathreturnlist of info. - Save
list of infointo DB.
In normal execution I have this code.
public void StartProcess() {
var settings = GetSettings();
CopyFiles(settings);
var listOfData = ReadFile(settings);
SaveListOfData(listOfData);
}
StartProcess method will be executed in a loop in which it waits for a file to read.
What would be a nice way to handle in which a program/code can retry specific process? For example there's an error on number 2 process, the program should execute process 2 and skip process 1.
Aucun commentaire:
Enregistrer un commentaire