Skip to content

Error: Cannot await in the body of a finally clause #20

@rydersan

Description

@rydersan

Hey!

There is the new and unexpected error. Copied error below...

Error 2 Cannot await in the body of a finally clause C:\Users{user}\Visual Studio 2013\Projects\Bitcoin Database Generator\BitcoinDatabaseGenerator\DatabaseGenerator.cs Line: 427

.....
finally
{
// Whatever we have in the pipeline we'll push to the DB. We do this in a finally block.
// Otherwise an exception that occurs in blockchain file 100 may prevent data that was
// collected in blockchain file 99 to be saved to DB.

            // Wait for the last remaining background tasks if any that are still executing 
            // sourceDataPipeline.FillBlockchainPipeline or the SQL bulk copy to finish.
            await taskDispatcher.WaitForAllWorkToComplete();

            // Instruct sourceDataPipeline to transfer all remaining data to the available data queue.
            // IMPORTANT: do not call this while there could still be threads executing sourceDataPipeline.FillBlockchainPipeline.
            sourceDataPipeline.Flush();

            // Now trigger the SQL bulk copy for the data that remains.
            await this.TransferAvailableData(taskDispatcher, sourceDataPipeline);

            // Wait for the last remaining background tasks if any that are still executing 
            // the SQL bulk copy to finish.
            await taskDispatcher.WaitForAllWorkToComplete();
        }

Does anyone knows the solvation of this error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions