private void ConfigureUploads()
        {
            if (!_svcConfig.UploadJobEnabled)
            {
                return;
            }


            if (File.Exists(UploadConfigFilePath))
            {
                _uploadConfig = FileTransferConfig.LoadFromJsonConfig(UploadConfigFilePath);

                if (_uploadConfig.IntervalInSeconds > 0)
                {
                    _uploadInterval = _uploadConfig.IntervalInSeconds;
                }
                if (!String.IsNullOrWhiteSpace(_uploadConfig.CronExp))
                {
                    _uploadCron = _uploadConfig.CronExp;
                }
            }
            else
            {
                _log.Fatal($"Configuration file does not exist {UploadConfigFilePath}");
            }
        }
示例#2
0
        private bool LoadConfig(IJobExecutionContext context)
        {
            var configFilePath = context.JobDetail.JobDataMap.GetString("configFilePath");

            if (String.IsNullOrWhiteSpace(configFilePath) || !File.Exists(configFilePath))
            {
                _log.Fatal($"Configuration file not specified or does not exist '{configFilePath}'");
                return(false);
            }

            _config = FileTransferConfig.LoadFromJsonConfig(configFilePath);

            if (_config == null)
            {
                _log.Fatal($"Configuration file can not be loaded '{configFilePath}'");
                return(false);
            }

            return(true);
        }