Ejemplo n.º 1
0
        protected override void threadmain()
        {
            using (updateDB db = new updateDB(Program.connstr, Program.dbName))
            {
                while (true)
                {
                    if (queue.IsEmpty)
                    {
                        if (exitTime)
                        {
                            if (queue.IsEmpty)
                            {
                                break;
                            }
                        }

                        pollTimer.WaitOne(100);
                        continue;
                    }

                    if (!queue.TryDequeue(out downloadThread.downloadedUpdate updateToProcess) || updateToProcess == null)
                    {
                        continue;
                    }

                    currentlyProcessing = updateToProcess.update.parent.downloadURI;
                    UpdateProcessingStarted.Set();

                    updateToProcess.update.parent.startTime = DateTime.Now;
                    updateToProcess.update.OnLogString      = this.OnLogString;
                    try
                    {
                        updateToProcess.update.writeToDB(asyncSQLParams, updateToProcess.absolutepath);
                    }
                    catch (Exception e)
                    {
                        db.logError(updateToProcess.update.parent, e);
                    }

                    archiver.enqueue(updateToProcess.absolutepath);

                    currentlyProcessing = null;
                }
            }
        }
Ejemplo n.º 2
0
 private static void logger(string tolog)
 {
     logDB.logError(tolog);
 }