Clean() 공개 메소드

public Clean ( ) : void
리턴 void
예제 #1
0
파일: BackupJob.cs 프로젝트: frapid/frapid
        public void Execute(IJobExecutionContext context)
        {
            string fileName = DateTimeOffset.UtcNow.Ticks.ToString();
            var domains = TenantConvention.GetDomains();

            foreach (var domain in domains)
            {
                string tenant = TenantConvention.GetDbNameByConvention(domain.DomainName);
                string directory = this.GetBackupDirectory(domain, tenant);


                var server = new DbServer(tenant);
                var agent = this.GetAgent(server, fileName, tenant, directory);

                try
                {
                    agent.BackupAsync
                        (
                            done =>
                            {
                                var backup = new Resources(tenant, directory, fileName);

                                backup.AddTenantDataToBackup();
                                backup.Compress();
                                backup.Clean();
                            },
                            error => { Log.Error($"Could not backup because and error occurred. \n\n{error}"); })
                        .Wait();
                }
                catch (Exception ex)
                {
                    Log.Error("Exception occurred executing the backup job. {Exception}.", ex);
                }
            }
        }
예제 #2
0
        public void Execute(IJobExecutionContext context)
        {
            string fileName = DateTimeOffset.UtcNow.Ticks.ToString();
            var    domains  = TenantConvention.GetDomains();

            foreach (var domain in domains)
            {
                string tenant    = TenantConvention.GetDbNameByConvention(domain.DomainName);
                string directory = this.GetBackupDirectory(domain, tenant);


                var server = new DbServer(tenant);
                var agent  = this.GetAgent(server, fileName, tenant, directory);

                try
                {
                    agent.BackupAsync
                    (
                        done =>
                    {
                        var backup = new Resources(tenant, directory, fileName);

                        backup.AddTenantDataToBackup();
                        backup.Compress();
                        backup.Clean();
                    },
                        error => { Log.Error($"Could not backup because and error occurred. \n\n{error}"); })
                    .Wait();
                }
                catch (Exception ex)
                {
                    Log.Error("Exception occurred executing the backup job. {Exception}.", ex);
                }
            }
        }