Exemple #1
0
        public async Task ProcessJob(JobInfo jobInfo, UserAccount userInfo, IProgressLog progressLog)
        {
            ProgressLog = progressLog;
            JobInfo     = jobInfo;
            var authenticationClaim =
                userInfo.Claims.FirstOrDefault(c => c.Type.Equals(DataDockClaimTypes.GitHubAccessToken));

            AuthenticationToken = authenticationClaim?.Value;
            if (string.IsNullOrEmpty(AuthenticationToken))
            {
                Log.Error("No authentication token found for user {userId}", userInfo.UserId);
                ProgressLog.Error("Could not find a valid GitHub access token for this user account. Please check your account settings.");
                throw new WorkerException("Could not find a valid GitHub access token for this user account. Please check your account settings.");
            }
            await RunJob(jobInfo, userInfo);
        }
        public async Task ProcessJob(JobInfo job, UserAccount userAccount, IProgressLog progressLog)
        {
            // Delete the schema from documentDB
            try
            {
                progressLog.UpdateStatus(JobStatus.Running, $"Deleting schema {job.SchemaId}");
                await _schemaStore.DeleteSchemaAsync(null, job.SchemaId);

                progressLog.UpdateStatus(JobStatus.Running, "Schema deleted successfully");
            }
            catch (Exception ex)
            {
                progressLog.Error("Failed to remove schema record");
                Log.Error(ex, "Failed to remove schema record");
                throw new WorkerException(ex, "Failed to delete schema record.");
            }
        }