Esempio n. 1
0
 public WorkspaceListeners(
     FileAnalyzerService fileAnalyzerService,
     IHubContext <WorkspaceHub, IWorkspaceHubClient> workspaceHub)
 {
     _fileAnalyzerService = fileAnalyzerService;
     _workspaceHub        = workspaceHub;
 }
Esempio n. 2
0
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseHsts();
            }

            #region custom pipeline configuration

            app.UseHangfireDashboard();


            FileAnalyzerService analyzerService = new FileAnalyzerService();


            //5 seg interval to call the recurrent job
            RecurringJob.AddOrUpdate(
                () => analyzerService.Execute(),
                "*/5 * * * * *");

            app.UseSerilogRequestLogging();

            #endregion

            app.UseRouting();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();
            });
        }
Esempio n. 3
0
        public void Setup()
        {
            // create new service instance
            _service = new FileAnalyzerService();

            ///setting enviroment to test project
            var projectPath = Path.GetFullPath(Path.Combine(AppContext.BaseDirectory, "..\\..\\..\\"));

            System.Environment.CurrentDirectory = projectPath;
            //setting logger
            log = new LoggerConfiguration()
                  .WriteTo.Console(restrictedToMinimumLevel: LogEventLevel.Verbose)
                  .CreateLogger();
            //initialize service
        }