Check-in [43bfe70cba]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Only report times when done, not for each folder.
Timelines: family | ancestors | descendants | both | dotnet/timers
Files: files | file ages | folders
SHA1: 43bfe70cba14e29d4383efa69dd702ea24cf156e
User & Date: tinus 2019-09-07 06:38:28
Wiki:dotnet/timers
Context
2019-09-10
19:09
Merge dotnet into dotnet/timers. check-in: e0c73936fc user: tinus tags: dotnet/timers
2019-09-07
06:38
Only report times when done, not for each folder. check-in: 43bfe70cba user: tinus tags: dotnet/timers
2019-09-03
20:28
Merge dotnet into dotnet/timers. check-in: b7de6a53d1 user: tinus tags: dotnet/timers
Changes

Changes to MailSynchronizer.cs.

111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
...
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166

                    TimerCollection.Global.Start("SynchronizeFolder");
                    try {
                    await SynchronizeFolder(mailFolder, dbFolder);
                    } finally {
                        TimerCollection.Global.Stop("SynchronizeFolder");
                    }
                    Con.WriteLine(); Con.WriteLine(TimerCollection.Global.ToString(), System.Diagnostics.TraceLevel.Verbose);

                    if (mailFolder.UidNext != null)
                    {
                        using (var work = new UnitOfWork(_cancellationToken))
                        {
                            dbFolder = await work.Folders.GetByIdAsync(dbFolder.ID);
                            dbFolder.UIDNext = mailFolder.UidNext.Value.Id;
................................................................................
            TimerCollection.Global.Start("ClearUnunsedObjects");
            try
            {
                // clean up free messages and participants
                _participants.Clear();
                _keywords.Clear();
                await ClearUnunsedObjectsAsync(vacuumDatabase);

            }
            finally
            {
                TimerCollection.Global.Stop("ClearUnunsedObjects");
            }
        }








|







 







<







111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
...
152
153
154
155
156
157
158

159
160
161
162
163
164
165

                    TimerCollection.Global.Start("SynchronizeFolder");
                    try {
                    await SynchronizeFolder(mailFolder, dbFolder);
                    } finally {
                        TimerCollection.Global.Stop("SynchronizeFolder");
                    }
                    //Con.WriteLine(); Con.WriteLine(TimerCollection.Global.ToString(), System.Diagnostics.TraceLevel.Verbose);

                    if (mailFolder.UidNext != null)
                    {
                        using (var work = new UnitOfWork(_cancellationToken))
                        {
                            dbFolder = await work.Folders.GetByIdAsync(dbFolder.ID);
                            dbFolder.UIDNext = mailFolder.UidNext.Value.Id;
................................................................................
            TimerCollection.Global.Start("ClearUnunsedObjects");
            try
            {
                // clean up free messages and participants
                _participants.Clear();
                _keywords.Clear();
                await ClearUnunsedObjectsAsync(vacuumDatabase);

            }
            finally
            {
                TimerCollection.Global.Stop("ClearUnunsedObjects");
            }
        }

Changes to Program.cs.

79
80
81
82
83
84
85

86
87

88
89
90
91
92
93
94

                // Return meaningful error codes
                if (ex is TaskCanceledException || ex is OperationCanceledException) result = ResultCode.Cancelled; // operation canceled
                else if (ex is ServiceNotAuthenticatedException) result = ResultCode.AuthenticationProblem; // authentication problem
                else if (ex is ServiceNotConnectedException) result = ResultCode.ConnectionProblem; // mail server connection problem
                else result = ResultCode.Exception; // unexpected problem
            }


            Con.WriteLine(TimerCollection.Global.ToString());


            return (int)result;
        }

        // TODO: use an FTS table to enable searching for messages
    }
}







>
|
|
>







79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96

                // Return meaningful error codes
                if (ex is TaskCanceledException || ex is OperationCanceledException) result = ResultCode.Cancelled; // operation canceled
                else if (ex is ServiceNotAuthenticatedException) result = ResultCode.AuthenticationProblem; // authentication problem
                else if (ex is ServiceNotConnectedException) result = ResultCode.ConnectionProblem; // mail server connection problem
                else result = ResultCode.Exception; // unexpected problem
            }
            finally
            {
                Con.WriteLine(TimerCollection.Global.ToString());
            }

            return (int)result;
        }

        // TODO: use an FTS table to enable searching for messages
    }
}