Git Product home page Git Product logo

coravelpro's Introduction

About Me

I'm a senior developer with a focus on software architecture and design. My expertise is in Microsoft technologies like C#, .NET and TypeScript. I live in Canada 🍁 and work remotely πŸ‘¨β€πŸ’».

Career highlights include:

Around The Web

Want To Work With Me?

Check out my website for more about working with me.

coravelpro's People

Contributors

jamesmh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

coravelpro's Issues

Entity Framework Dependency in Pro Package

First, I recently started using your scheduling library and it was really easy to setup and get working so thanks! Highly recommend.

My question or maybe suggestion is to reconsider the dependency on Entity Framework for the pro package. I think there are other single file(or small otherwise) orm's that could be used. We don't use EF in any of or projects and I'm just not keen on adding that dependency.

Dapper is an example, there are others out there as well.

Software Issue (Does not detect end of process)

Hello,

I am using .NEt Core v3.0 (MVC)

I love your software, and would love to purchase a licence, but facing two issues:

  • Is there a way to integrate logging and progress so it appears in the dashboard ?

When I launch a very simple process:

public EBPInvoicesManagement(IConfiguration Configuration)
{
myService = new GP_App_Services(Configuration);
}

    public Task Invoke()
    {
        System.Threading.Thread.Sleep(5000);

        return (Task.CompletedTask);
 }

}

it will not detect the end of the process and will stay in "Running state" in the dashboard.

Kind regards

How to set up time zones to support localization

//ConfigureServices method
services.Configure(options => {
options.DefaultRequestCulture = new Microsoft.AspNetCore.Localization.RequestCulture(new CultureInfo("zh-CN"));
});

//Configure method
var requestLocalizationOptions = app.ApplicationServices.GetService<IOptions>().Value;
app.UseRequestLocalization(requestLocalizationOptions);

The above settings do not work !!!

How to set up "Coravel" to support localization time zone ?

question: how is scheduling work?

Hi, I had an issue when I have a job scheduled to run every hour and my app restarts 3 times in an hour.

does coravel scheduling engine run on every startup and run every job, start every scheduling from that time? or it does check the last ran job in database and run based on previous records?

ICoravelProDbContext incorrectly has `set` on property

I believe the interface for ICoravelProDbContext is too restrictive in its implementation. The following interface of ICoravelProDbContext should not contain a set for the property.

  public interface ICoravelProDbContext
  {
    DbSet<CoravelJobHistory> Coravel_JobHistory { get; set; }

    DbSet<CoravelScheduledJob> Coravel_ScheduledJobs { get; set; }

    DbSet<CoravelScheduledJobHistory> Coravel_ScheduledJobHistory { get; set; }
  }

A DbContext only requires a get method for any DbSet property. For example, the following is completely valid.

public class Database : DbContext, ICoravelProDbContext
{
    protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        => optionsBuilder.UseSqlite("data source=app.db");
    
    // ReSharper disable once InconsistentNaming
    public DbSet<CoravelJobHistory> Coravel_JobHistory => Set<CoravelJobHistory>();
    // ReSharper disable once InconsistentNaming
    public DbSet<CoravelScheduledJob> Coravel_ScheduledJobs => Set<CoravelScheduledJob>();
    // ReSharper disable once InconsistentNaming
    public DbSet<CoravelScheduledJobHistory> Coravel_ScheduledJobHistory => Set<CoravelScheduledJobHistory>();
}

Yet, the inclusion of set forces users to implement a {get;set;}.

JetBrains Rider -2023-04-19 -11-56-33

Suggestions for updating assumptions / documentation

The pro library seems to assume folks are using:

  • Microsoft MVC Routing
  • EF migrations
  • dbo schema

I'd like to suggest that you not make these assumptions. In our case, I had to add app.UseRouting() to get Pro working. We use fluent migrator, not EF migrations. Fortunately, I found your previous ticket where you posted the SQL Create Table statements. I was able to create migrations from this information. Also, these create statements (assuming also your EF migrations) assume the dbo schema. In our case, this particular application uses its own schema (not DBO).

Add support for registered sub applications

Some Coravel paths break when registering applications at a sub path in IIS.

For example, set the applicationUrl in launchSettings.json:

{
  "iisSettings": {
    "windowsAuthentication": true,
    "anonymousAuthentication": false,
    "iisExpress": {
      "applicationUrl": "http://localhost:39350/app",
      "sslPort": 44343
    }
  }
}

This will configure tha applicationhost.config at .vs/Sample/config/

    <sites>
      <site name="Sample" id="1">
        <application path="/app" applicationPool="app AppPool">
          <virtualDirectory path="/" physicalPath="C:\github.com\DanElliott\coravel-pro-issue" />
        </application>
      </site>
    </sites>

Navigating to /app/Coravel/Scheduling works as expected, but submissions fail and the TimeZone input fails to load the list of TimeZones.

image

Also, I'm not sure if it's related, but I do get and Antiforgery issue about 15 line up from the bottom with this setup as well:

Starting IIS Express ...
Successfully registered URL "http://localhost:39350/app/" for site "Sample" application "/app"
Successfully registered URL "https://localhost:44343/app/" for site "Sample" application "/app"
Registration completed for site "Sample"
IIS Express is running.
[12:07:33 INF] Started application
Don't forget that using Coravel.Pro in commercial scenarios requires a license: https://www.pro.coravel.net
[12:07:35 DBG] 'ApplicationDbContext' disposed.
[12:07:35 DBG] Loaded hosting startup assembly Sample
[12:07:35 INF] Request starting HTTP/1.1 GET https://localhost:44343/app/Coravel/Scheduling  
[12:07:35 DBG] Initializing Razor view compiler with compiled view: '/Areas/Coravel/Pages/Dashboard.cshtml'.
[12:07:35 DBG] Initializing Razor view compiler with compiled view: '/Areas/Coravel/Pages/Jobs.cshtml'.
[12:07:35 DBG] Initializing Razor view compiler with compiled view: '/Areas/Coravel/Pages/Lenses.cshtml'.
[12:07:35 DBG] Initializing Razor view compiler with compiled view: '/Areas/Coravel/Pages/Resources.cshtml'.
[12:07:35 DBG] Initializing Razor view compiler with compiled view: '/Areas/Coravel/Pages/Scheduling.cshtml'.
[12:07:35 DBG] Initializing Razor view compiler with compiled view: '/Areas/Coravel/Pages/Shared/_CoravelScripts.cshtml'.
[12:07:35 DBG] Initializing Razor view compiler with compiled view: '/Areas/Coravel/Pages/Shared/_CoravelStyles.cshtml'.
[12:07:35 DBG] Initializing Razor view compiler with compiled view: '/Areas/Coravel/Pages/_Layout.cshtml'.
[12:07:35 DBG] Initializing Razor view compiler with compiled view: '/Areas/Coravel/Pages/_ViewImports.cshtml'.
[12:07:35 DBG] Initializing Razor view compiler with compiled view: '/Areas/Coravel/Pages/_ViewStart.cshtml'.
[12:07:35 DBG] Initializing Razor view compiler with compiled view: '/Areas/Coravel/Pages/Dashboard.cshtml'.
[12:07:35 DBG] Initializing Razor view compiler with compiled view: '/Areas/Coravel/Pages/Jobs.cshtml'.
[12:07:35 DBG] Initializing Razor view compiler with compiled view: '/Areas/Coravel/Pages/Lenses.cshtml'.
[12:07:35 DBG] Initializing Razor view compiler with compiled view: '/Areas/Coravel/Pages/Resources.cshtml'.
[12:07:35 DBG] Initializing Razor view compiler with compiled view: '/Areas/Coravel/Pages/Scheduling.cshtml'.
[12:07:35 DBG] Initializing Razor view compiler with compiled view: '/Areas/Coravel/Pages/Shared/_CoravelScripts.cshtml'.
[12:07:35 DBG] Initializing Razor view compiler with compiled view: '/Areas/Coravel/Pages/Shared/_CoravelStyles.cshtml'.
[12:07:35 DBG] Initializing Razor view compiler with compiled view: '/Areas/Coravel/Pages/_Layout.cshtml'.
[12:07:35 DBG] Initializing Razor view compiler with compiled view: '/Areas/Coravel/Pages/_ViewImports.cshtml'.
[12:07:35 DBG] Initializing Razor view compiler with compiled view: '/Areas/Coravel/Pages/_ViewStart.cshtml'.
[12:07:35 DBG] 1 candidate(s) found for the request path '/Coravel/Scheduling'
[12:07:35 DBG] Endpoint 'Page: /Scheduling' with route pattern 'Coravel/Scheduling' is valid for the request path '/Coravel/Scheduling'
[12:07:35 DBG] Request matched endpoint '/Scheduling'
[12:07:35 INF] Executing endpoint '/Scheduling'
[12:07:35 DBG] Registered model binder providers, in the following order: ["Microsoft.AspNetCore.Mvc.ModelBinding.Binders.BinderTypeModelBinderProvider", "Microsoft.AspNetCore.Mvc.ModelBinding.Binders.ServicesModelBinderProvider", "Microsoft.AspNetCore.Mvc.ModelBinding.Binders.BodyModelBinderProvider", "Microsoft.AspNetCore.Mvc.ModelBinding.Binders.HeaderModelBinderProvider", "Microsoft.AspNetCore.Mvc.ModelBinding.Binders.FloatingPointTypeModelBinderProvider", "Microsoft.AspNetCore.Mvc.ModelBinding.Binders.EnumTypeModelBinderProvider", "Microsoft.AspNetCore.Mvc.ModelBinding.Binders.SimpleTypeModelBinderProvider", "Microsoft.AspNetCore.Mvc.ModelBinding.Binders.CancellationTokenModelBinderProvider", "Microsoft.AspNetCore.Mvc.ModelBinding.Binders.ByteArrayModelBinderProvider", "Microsoft.AspNetCore.Mvc.ModelBinding.Binders.FormFileModelBinderProvider", "Microsoft.AspNetCore.Mvc.ModelBinding.Binders.FormCollectionModelBinderProvider", "Microsoft.AspNetCore.Mvc.ModelBinding.Binders.KeyValuePairModelBinderProvider", "Microsoft.AspNetCore.Mvc.ModelBinding.Binders.DictionaryModelBinderProvider", "Microsoft.AspNetCore.Mvc.ModelBinding.Binders.ArrayModelBinderProvider", "Microsoft.AspNetCore.Mvc.ModelBinding.Binders.CollectionModelBinderProvider", "Microsoft.AspNetCore.Mvc.ModelBinding.Binders.ComplexTypeModelBinderProvider"]
[12:07:35 INF] Route matched with {page = "/Scheduling", area = "Coravel"}. Executing page /Scheduling
[12:07:35 DBG] Execution plan of authorization filters (in the following order): ["Microsoft.AspNetCore.Mvc.ViewFeatures.Filters.AutoValidateAntiforgeryTokenAuthorizationFilter"]
[12:07:35 DBG] Execution plan of resource filters (in the following order): ["Microsoft.AspNetCore.Mvc.ViewFeatures.Filters.SaveTempDataFilter"]
[12:07:35 DBG] Execution plan of action filters (in the following order): ["Microsoft.AspNetCore.Mvc.ModelBinding.UnsupportedContentTypeFilter (Order: -3000)"]
[12:07:35 DBG] Execution plan of exception filters (in the following order): ["None"]
[12:07:35 DBG] Execution plan of result filters (in the following order): ["Microsoft.AspNetCore.Mvc.ViewFeatures.Filters.SaveTempDataFilter"]
[12:07:35 DBG] Executing page model factory for page Coravel.Pro.Coravel.Pages.Areas_Coravel_Pages_Scheduling (Coravel.Pro.Views)
[12:07:36 DBG] Executed page model factory for page Coravel.Pro.Coravel.Pages.Areas_Coravel_Pages_Scheduling (Coravel.Pro.Views)
[12:07:36 INF] Executing handler method Coravel.Pro.Coravel.Pages.SchedulingModel.OnGet - ModelState is Valid
[12:07:36 INF] Entity Framework Core 3.1.7 initialized 'ApplicationDbContext' using provider 'Microsoft.EntityFrameworkCore.InMemory' with options: StoreName=JobBoard 
[12:07:36 INF] Executed handler method OnGet, returned result Microsoft.AspNetCore.Mvc.RazorPages.PageResult.
[12:07:36 DBG] An antiforgery cookie token was reused.
[12:07:36 INF] Executed page /Scheduling in 636.2394ms
[12:07:36 INF] Executed endpoint '/Scheduling'
[12:07:36 DBG] 'ApplicationDbContext' disposed.
[12:07:36 INF] Request finished in 1275.8531ms 200 text/html; charset=utf-8
[12:07:37 INF] Request starting HTTP/1.1 GET https://localhost:44343/app/Coravel/fonts/element-icons.woff  
[12:07:37 DBG] No candidates found for the request path '/Coravel/fonts/element-icons.woff'
[12:07:37 DBG] Request did not match any endpoints
[12:07:37 DBG] The request path /Coravel/fonts/element-icons.woff does not match an existing file
[12:07:37 INF] Request finished in 29.4328ms 404 
[12:07:37 INF] Request starting HTTP/1.1 GET https://localhost:44343/app/Coravel/fonts/element-icons.ttf  
[12:07:37 DBG] No candidates found for the request path '/Coravel/fonts/element-icons.ttf'
[12:07:37 DBG] Request did not match any endpoints
[12:07:37 DBG] The request path /Coravel/fonts/element-icons.ttf does not match an existing file
[12:07:37 INF] Request finished in 13.8863ms 404 

Jobs Killed By Terminated Process Never "End" On UI

Sometimes you have jobs that are terminated abruptly due to the running dotnet process being killed without being allowed to gracefully shutdown.

In these cases, those jobs will keep "running" on the UI job history.

Error "ScheduleInvocableType must be passed in a type that implements IInvocable."

I can't get Coravel Pro working for a ASP.NET Core 3.1 web app. (Start new project...)

  • ASP.NET Core 3.1
  • Coravel.Pro (2.0.0) (I also tried older versions)
  • Coravel (3.2.0) (I also tried older versions)
  • Microsoft.AspNetCore.Identity.EntityFrameworkCore (3.1.1)
  • Microsoft.EntityFrameworkCore.SqlServer (3.1.1)

public class TestJob : IInvocable { public Task Invoke() { Console.WriteLine("Test"); return Task.CompletedTask; } }

`public void ConfigureServices(IServiceCollection services)
{
services.AddRazorPages().AddNewtonsoftJson();

        services.AddDbContext<ApplicationDbContext>(options => {
            options.UseSqlServer(Configuration.GetConnectionString("MyConnection"));
        });

        services.AddTransient<TestJob>();

        services.AddScheduler();

        services.AddCoravelPro(typeof(ApplicationDbContext));
    }`

`public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
else
{
app.UseExceptionHandler("/Error");
}

        app.UseStaticFiles();

        app.UseRouting();

        app.UseAuthorization();

        app.UseEndpoints(endpoints =>
        {
            endpoints.MapRazorPages();
        });

        var provider = app.ApplicationServices;
        provider.UseScheduler(scheduler =>
        {
            scheduler.Schedule<TestJob>()
                .EveryTenMinutes();
        });
        
        app.UseCoravelPro();
    }`

Error on app.UseCoravelPro() : ScheduleInvocableType must be passed in a type that implements IInvocable.

Schedule have fail message

Schedule task has success and finished, but get a fail message

image

Using Coravel (not pro), not the fail message

I have "System.NullReferenceException" in app.UseCoravelPro();

An error occurred while starting the application.

NullReferenceException: Object reference not set to an instance of an object.

Coravel.Pro.Features.Jobs.UseCases.MarkJobsKilledByTerminatedProcessCommand.Invoke()

Coravel.Pro.Features.Jobs.UseCases.MarkJobsKilledByTerminatedProcessCommand.Invoke()
Coravel.Pro.ServiceRegistration.MarkJobsTerminatedByPreviouslyKilledProcess(IApplicationBuilder app)
Coravel.Pro.ServiceRegistration.UseCoravelPro(IApplicationBuilder app)
CoravelTest.Startup.Configure(IApplicationBuilder app, IHostingEnvironment env) in Startup.cs
+
            app.UseCoravelPro();
Microsoft.AspNetCore.Hosting.ConventionBasedStartup.Configure(IApplicationBuilder app)
Microsoft.AspNetCore.Mvc.Internal.MiddlewareFilterBuilderStartupFilter+<>c__DisplayClass0_0.<Configure>g__MiddlewareFilterBuilder|0(IApplicationBuilder builder)
Microsoft.AspNetCore.Server.IIS.Core.IISServerSetupFilter+<>c__DisplayClass2_0.<Configure>b__0(IApplicationBuilder app)
Microsoft.AspNetCore.HostFilteringStartupFilter+<>c__DisplayClass0_0.<Configure>b__0(IApplicationBuilder app)
Microsoft.AspNetCore.Hosting.Internal.AutoRequestServicesStartupFilter+<>c__DisplayClass0_0.<Configure>b__0(IApplicationBuilder builder)
Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()

:-(

jobs dashboard only displays "Not a Registered Service"

As the title says, after performing the following steps:

  1. Using Asp.Net Core and EF Core 2.2
  2. Installed both Coravel (3.0.0) and Coravel.Pro(1.2.1) NuGet packages
  3. Added services.AddCoravelPro(typeof(ApplicationDbContext)); to the Startup ConfigureServices method (where the db context name is effectively ApplicationDbContext)
  4. Added app.UseCoravelPro(); to Startup Configure method (tried both after and before UseMvc
  5. Made my DbContext implement the ICoravelProDbContext and created/applied related migration (did verify the tables are present in the database)
  6. Implemented an Coravel.Invocable.IInvocable and added it to the services container as a Transient dependency
  7. Started the app, hoping for the best....

Yet, when accessing the dashboard's Jobs page, under the Jobs section, it only displays "Not a Registered Service" on the right column under the "Execute" header

image

I'd like to know if you would have an idea of what can cause this message to appear :)

Thanks in advance and have a great day!

Exception on second and subsequent requests to Completed panel at Coravel/Scheduling

The first time I open /Coravel/Scheduling, I can see the completed job history. Subsequent page refreshes or paging in the completed panel cause the exception below. Every other feature works fine and the history is being written to the DB. Framework is 3.1 Core and EF is 3.1.7, DB is SQL Server 2019. I had the same issue with EF 3.1.5 as well. The scheduler is working fine and creating new jobs is fine. Any assistance is appreciated.

Exception is caused from ScheduledJobHistoryQuery.GetHistory(Int32 page).

Microsoft.EntityFrameworkCore.Query[10100]
An exception occurred while iterating over the results of a quer
y for context type 'Platform.CustApp.Persistence.Context.AppDbConte
xt'.
System.InvalidOperationException: BeginExecuteReader requires an
open and available Connection. The connection's current state is clos
ed.
at Microsoft.Data.SqlClient.SqlCommand.<>c.b__169_0(Task1 result) at System.Threading.Tasks.ContinuationResultTaskFromResultTas k2.InnerInvoke()
at System.Threading.Tasks.Task.<>c.<.cctor>b__274_0(Object ob
j)
at System.Threading.ExecutionContext.RunInternal(ExecutionCon
text executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception wa
s thrown ---
at System.Threading.ExecutionContext.RunInternal(ExecutionCon
text executionContext, ContextCallback callback, Object state)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& c
urrentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location where exception wa
s thrown ---
at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.Ex
ecuteReaderAsync(RelationalCommandParameterObject parameterObject, Can
cellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.Ex
ecuteReaderAsync(RelationalCommandParameterObject parameterObject, Can
cellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.Ex
ecuteReaderAsync(RelationalCommandParameterObject parameterObject, Can
cellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnume
rable1.AsyncEnumerator.InitializeReaderAsync(DbContext _, Boolean res ult, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.S qlServerExecutionStrategy.ExecuteAsync[TState,TResult](TState state, F unc4 operation, Func4 verifySucceeded, CancellationToken cancellatio nToken) at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnume rable1.AsyncEnumerator.MoveNextAsync()
System.InvalidOperationException: BeginExecuteReader requires an open
and available Connection. The connection's current state is closed.
at Microsoft.Data.SqlClient.SqlCommand.<>c.b__169_0(Task1 result) at System.Threading.Tasks.ContinuationResultTaskFromResultTask2.In
nerInvoke()
at System.Threading.Tasks.Task.<>c.<.cctor>b__274_0(Object obj)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext e
xecutionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thro
wn ---
at System.Threading.ExecutionContext.RunInternal(ExecutionContext e
xecutionContext, ContextCallback callback, Object state)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& current
TaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location where exception was thro
wn ---
at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteR
eaderAsync(RelationalCommandParameterObject parameterObject, Cancellat
ionToken cancellationToken)
at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteR
eaderAsync(RelationalCommandParameterObject parameterObject, Cancellat
ionToken cancellationToken)
at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteR
eaderAsync(RelationalCommandParameterObject parameterObject, Cancellat
ionToken cancellationToken)
at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable 1.AsyncEnumerator.InitializeReaderAsync(DbContext _, Boolean result, C ancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServ erExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func4
operation, Func4 verifySucceeded, CancellationToken cancellationToken ) at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable
1.AsyncEnumerator.MoveNextAsync()
fail: Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewar
e[1]
An unhandled exception has occurred while executing the request.

System.InvalidOperationException: BeginExecuteReader requires an open
and available Connection. The connection's current state is closed.
at Microsoft.Data.SqlClient.SqlCommand.<>c.b__169_0(Task1 result) at System.Threading.Tasks.ContinuationResultTaskFromResultTask2.In
nerInvoke()
at System.Threading.Tasks.Task.<>c.<.cctor>b__274_0(Object obj)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext e
xecutionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thro
wn ---
at System.Threading.ExecutionContext.RunInternal(ExecutionContext e
xecutionContext, ContextCallback callback, Object state)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& current
TaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location where exception was thro
wn ---
at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteR
eaderAsync(RelationalCommandParameterObject parameterObject, Cancellat
ionToken cancellationToken)
at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteR
eaderAsync(RelationalCommandParameterObject parameterObject, Cancellat
ionToken cancellationToken)
at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteR
eaderAsync(RelationalCommandParameterObject parameterObject, Cancellat
ionToken cancellationToken)
at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable 1.AsyncEnumerator.InitializeReaderAsync(DbContext _, Boolean result, C ancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServ erExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func4
operation, Func4 verifySucceeded, CancellationToken cancellationToken ) at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable
1.AsyncEnumerator.MoveNextAsync()
at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions
.ToListAsync[TSource](IQueryable1 source, CancellationToken cancellat ionToken) at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions .ToListAsync[TSource](IQueryable1 source, CancellationToken cancellat
ionToken)
at Coravel.Pro.Features.Jobs.UseCases.ScheduledJobHistoryQuery.GetH
istory(Int32 page)
at Coravel.Pro.Coravel.Pages.SchedulingModel.OnPostGetHistory(GetHi
storyModel model)
at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.ExecutorFacto
ry.GenericTaskHandlerMethod.Convert[T](Object taskAsObject)
at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.ExecutorFacto
ry.GenericTaskHandlerMethod.Execute(Object receiver, Object[] argument
s)
at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInv
oker.InvokeHandlerMethodAsync()
at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInv
oker.InvokeNextPageFilterAsync()
at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInv
oker.Rethrow(PageHandlerExecutedContext context)
at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInv
oker.Next(State& next, Scope& scope, Object& state, Boolean& isComplet
ed)
at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInv
oker.InvokeInnerFilterAsync()
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|24_0(ResourceInvoker invoker, Task lastTa
sk, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(
ResourceExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(Sta
te& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|19_0(ResourceInvoker invoker, Task lastT
ask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker)
at Microsoft.AspNetCore.Routing.EndpointMiddleware.g__Await
RequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invok
e(HttpContext context)
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Inv
oke(HttpContext context)
at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContex
t context)
at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContex
t context)
at StackExchange.Profiling.MiniProfilerMiddleware.Invoke(HttpContex
t context) in C:\projects\dotnet\src\MiniProfiler.AspNetCore\MiniProfi
lerMiddleware.cs:line 105
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewar
e.Invoke(HttpContext context)

Coravel Pro Admin Dashboard 404

Hello, I am using Coravel Pro version 2.1.1.
I am using Dotnet Core 3.1.
Admin Dashboard returns 404 even though I have made the following configurations.

Startup.cs => ConfigureServices
services.addcoravelpro (typeof (mydbcontext));

Startup.cs => Configure
Β  app.usecoravelpro ();

admin dashboard: /Coravel/Dashboard /
There is no problem in creating database. The problem is I can't access the admin panel.

UseCoravelPro() error

I have an error at this line: app.UseCoravelPro(). The error says:

System.InvalidOperationException: 'No service for type 'GP.SS.Database.SaldeoSynchronizatorContext' has been registered.'

But according to the documentation I have registered it:

services.AddDbContext<ISaldeoSynchronizatorContext, SaldeoSynchronizatorContext>( opts => opts.UseOracle(Configuration.GetConnectionString("SaldeoSynchronizatorDB"), b => b.MigrationsAssembly(typeof(ISaldeoSynchronizatorContext).Namespace)) );

services.AddCoravelPro(typeof(SaldeoSynchronizatorContext));

RemoveCoravelProHistoryDataAfter30Days causing efcore error

My company has been using coravel pro for a while now and we love the product!

We have an exception that occurs repeatedly at 0:00 UTC. The error is occurring while running the RemoveCoravelProHistoryDataAfter30Days invocable which runs 2 efcore queries asynchronously. It hasn't thrown an exception every single day but does fairly frequently (10 out of the last 30 days).

Error Message:

A second operation was started on this context instance before a previous operation completed. This is usually caused by different threads concurrently using the same instance of DbContext. For more information on how to avoid threading issues with DbContext, see https://go.microsoft.com/fwlink/?linkid=2097913.

Stack Trace:

 at Microsoft.EntityFrameworkCore.Infrastructure.Internal.ConcurrencyDetector.EnterCriticalSection()
   at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.MoveNextAsync()
   at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable`1 source, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable`1 source, CancellationToken cancellationToken)
   at Coravel.Pro.EntityFramework.Invocables.RemoveCoravelProHistoryDataAfter30Days.Invoke()
   at Coravel.Scheduling.Schedule.Event.ScheduledEvent.InvokeScheduledEvent(CancellationToken cancellationToken) in C:\Users\james\code\github\coravel\Src\Coravel\Scheduling\Schedule\Event\ScheduledEvent.cs:line 129
   at Coravel.Scheduling.Schedule.Scheduler.<>c__DisplayClass28_0.<<InvokeEvent>g__Invoke|0>d.MoveNext() in C:\Users\james\code\github\coravel\Src\Coravel\Scheduling\Schedule\Scheduler.cs:line 165
--- End of stack trace from previous location ---
   at Coravel.Scheduling.Schedule.Scheduler.InvokeEvent(ScheduledEvent scheduledEvent) in C:\Users\james\code\github\coravel\Src\Coravel\Scheduling\Schedule\Scheduler.cs:line 196
public async Task Invoke()
{
  DateTimeOffset thirtyDaysAgo = DateTimeOffset.UtcNow.AddDays(-30.0);
  Task<List<CoravelJobHistory>> oldHistory = this._db.Coravel_JobHistory.Where<CoravelJobHistory>((Expression<Func<CoravelJobHistory, bool>>) (h => h.EndedAt != new DateTime?() && (DateTimeOffset?) h.EndedAt < (DateTimeOffset?) thirtyDaysAgo)).ToListAsync<CoravelJobHistory>();
  Task<List<CoravelScheduledJobHistory>> oldScheduleHistory = this._db.Coravel_ScheduledJobHistory.Where<CoravelScheduledJobHistory>((Expression<Func<CoravelScheduledJobHistory, bool>>) (h => h.EndedAt != new DateTime?() && (DateTimeOffset?) h.EndedAt < (DateTimeOffset?) thirtyDaysAgo)).ToListAsync<CoravelScheduledJobHistory>();
  await Task.WhenAll((Task) oldHistory, (Task) oldScheduleHistory);
  DbSet<CoravelJobHistory> dbSet1 = this._db.Coravel_JobHistory;
  dbSet1.RemoveRange((IEnumerable<CoravelJobHistory>) await oldHistory);
  dbSet1 = (DbSet<CoravelJobHistory>) null;
  DbSet<CoravelScheduledJobHistory> dbSet2 = this._db.Coravel_ScheduledJobHistory;
  dbSet2.RemoveRange((IEnumerable<CoravelScheduledJobHistory>) await oldScheduleHistory);
  dbSet2 = (DbSet<CoravelScheduledJobHistory>) null;
  int num = await (this._db as DbContext).SaveChangesAsync();
  oldHistory = (Task<List<CoravelJobHistory>>) null;
  oldScheduleHistory = (Task<List<CoravelScheduledJobHistory>>) null;
}

When I run the following code from the method in LinqPad it throws and exception every time:

DateTimeOffset thirtyDaysAgo = DateTimeOffset.UtcNow.AddDays(-30.0);
Task<List<CoravelJobHistory>> oldHistory = Coravel_JobHistory.Where<CoravelJobHistory>((Expression<Func<CoravelJobHistory, bool>>)(h => h.EndedAt != new DateTime?() && (DateTimeOffset?)h.EndedAt < (DateTimeOffset?)thirtyDaysAgo)).ToListAsync<CoravelJobHistory>();
Task<List<CoravelScheduledJobHistory>> oldScheduleHistory = Coravel_ScheduledJobHistory.Where<CoravelScheduledJobHistory>((Expression<Func<CoravelScheduledJobHistory, bool>>)(h => h.EndedAt != new DateTime?() && (DateTimeOffset?)h.EndedAt < (DateTimeOffset?)thirtyDaysAgo)).ToListAsync<CoravelScheduledJobHistory>();
await Task.WhenAll((Task) oldHistory, (Task) oldScheduleHistory);

Could you await each task individually?

Thanks!

Jobs never stops showing it is running

First off, wonderful product! Thank you.

I am testing an upgrade from Coravel to Coravel Pro and when I click run on a job in the UI it runs but then continues to show it is running in the "Recent" section. I can click on run again and it does but it just keeps leaving additional entries in the "Recent" showing it running with the indicator spinning on all of them. Any thoughts?

Much appreciated,
Scott

Prevent Job from Queuing Multiple Times

It would be helpful if the "Run" button for a job would no longer be active after a job is ran and before it is completed. Currently it will just queue up multiple runs.

A work around for now is to use the "breaking change" popup so someone can't accidently click it twice.

How to create tables in database using script

I'm using Coravel pro trial and had a hard time with the DbContext.

We do not use migrations and use only database first approach. Whenever I run the app the app crashes at

app.UseCoravelPro();

and here is my sql script:

create table dbo.CoravelJobHistory(
	Id int identity primary key,
	StartedAt datetime null, 
	EndedAt  datetime null , 
	TypeFullPath nvarchar(max), 
	DisplayName  nvarchar(max), 
	Failed 	    bit, 
	ErrorMessage nvarchar(max), 
	StackTrace   nvarchar(max)
)
go

create table dbo.CoravelScheduledJob(
	Id int identity not null primary key,
	InvocableFullPath nvarchar(max),
	CronExpression	nvarchar(max),
	Frequency			nvarchar(max),
	Days				nvarchar(max),
	PreventOverlapping  bit,
	CreatedAt		datetime,
	Active				bit
)
go

create table dbo.CoravelScheduledJobHistory (
	Id int identity primary key,
	EndedAt datetime null,
	TypeFullPath nvarchar(max),
	DisplayName nvarchar(max),
	Failed bit,
	ErrorMessage nvarchar(max),
	StackTrace nvarchar(max)
)
go

the exception that is thrown at the UseCoravelPro() says:

System.Data.SqlClient.SqlException
HResult=0x80131904
Message=Invalid object name 'Coravel_JobHistory'.
Source=Core .Net SqlClient Data Provider
StackTrace:
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior) at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.Execute(IRelationalConnection connection, DbCommandMethod executeMethod, IReadOnlyDictionary2 parameterValues)
at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.ExecuteReader(IRelationalConnection connection, IReadOnlyDictionary2 parameterValues) at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable1.Enumerator.BufferlessMoveNext(DbContext _, Boolean buffer)
at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](TState state, Func3 operation, Func3 verifySucceeded)
at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable1.Enumerator.MoveNext() at Microsoft.EntityFrameworkCore.Query.Internal.LinqOperatorProvider.<_TrackEntities>d__172.MoveNext()
at Microsoft.EntityFrameworkCore.Query.Internal.LinqOperatorProvider.ExceptionInterceptor1.EnumeratorExceptionInterceptor.MoveNext() at System.Collections.Generic.List1.AddEnumerable(IEnumerable1 enumerable) at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source)
at Coravel.Pro.Features.Jobs.UseCases.MarkJobsKilledByTerminatedProcessCommand.Invoke()
at Coravel.Pro.ServiceRegistration.MarkJobsTerminatedByPreviouslyKilledProcess(IApplicationBuilder app)
at Coravel.Pro.ServiceRegistration.UseCoravelPro(IApplicationBuilder app)
at NQ.Jobs.CoravelStartup.Configure(IApplicationBuilder app) in D:\Projects\Quantum\source\API\NQ.Jobs\CoravelStartup.cs:line 26
at NQ.Api.Framework.Startup.Microsoft.AspNetCore.Hosting.IStartup.Configure(IApplicationBuilder app) in D:\Projects\Quantum\source\API\NQ.Platform\NQ.API\Framework\Startup.cs:line 141
at Microsoft.AspNetCore.Mvc.Internal.MiddlewareFilterBuilderStartupFilter.<>c__DisplayClass0_0.g__MiddlewareFilterBuilder|0(IApplicationBuilder builder)
at Microsoft.AspNetCore.HostFilteringStartupFilter.<>c__DisplayClass0_0.b__0(IApplicationBuilder app)
at Microsoft.AspNetCore.Hosting.Internal.AutoRequestServicesStartupFilter.<>c__DisplayClass0_0.b__0(IApplicationBuilder builder)
at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()

This exception was originally thrown at this call stack:
System.Data.SqlClient.SqlConnection.OnError(System.Data.SqlClient.SqlException, bool, System.Action<System.Action>)
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(System.Data.SqlClient.TdsParserStateObject, bool, bool)
System.Data.SqlClient.TdsParser.TryRun(System.Data.SqlClient.RunBehavior, System.Data.SqlClient.SqlCommand, System.Data.SqlClient.SqlDataReader, System.Data.SqlClient.BulkCopySimpleResultSet, System.Data.SqlClient.TdsParserStateObject, out bool)
System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
System.Data.SqlClient.SqlDataReader.MetaData.get()
System.Data.SqlClient.SqlCommand.FinishExecuteReader(System.Data.SqlClient.SqlDataReader, System.Data.SqlClient.RunBehavior, string)
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(System.Data.CommandBehavior, System.Data.SqlClient.RunBehavior, bool, bool, int, out System.Threading.Tasks.Task, bool, System.Data.SqlClient.SqlDataReader)
System.Data.SqlClient.SqlCommand.ExecuteReader(System.Data.CommandBehavior)
Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.Execute(Microsoft.EntityFrameworkCore.Storage.IRelationalConnection, Microsoft.EntityFrameworkCore.Diagnostics.DbCommandMethod, System.Collections.Generic.IReadOnlyDictionary<string, object>)
Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.ExecuteReader(Microsoft.EntityFrameworkCore.Storage.IRelationalConnection, System.Collections.Generic.IReadOnlyDictionary<string, object>)
...
[Call Stack Truncated]

What am I missing in the DB Script?

How to use with Load balanced UI, windows service

It appears Pro starts the scheduler by default in an ASPNET Core application. That makes load balancing a problem. Is there an approach to using the UI (which is very useful and timesaving) along with activating the EF scheduler function in a Windows service? The docs don't mention this approach, but perhaps there is a workaround?

Coravel Pro uses Coravel's Scheduling, Queuing and Event features under-the-covers. There's therefore no need to call AddScheduler, AddQueue and AddEvents. They should be removed if they exist.

Blazor web assembly, hosted and Coravel Dashboard

Hello,

Is there a way to use coravel pro with a blazor (web assembly, hosted ) application? I've tried everything I thought of and didn't manage to make it work. ( Swagger UI via swashbuckle works fine though).

feature request: is there any way to set custom names for IInvocables?

Hi, I've been working with the project for some time. and I think jobs names in control panel can be more descriptive. having some other name and description for the jobs in the control panel is great for domain users who did not write the code and might confuse them in scheduling the jobs. this would be great to use some kind of attribute or database entities on it.

Error: No service for type ApplicationDbContext has been registered

I'm testing the application, but I can't run the application. I'm using .net core 3.0 and Coravel.Pro 4.0.2

I'm getting the following error on the line: app.UseCoravelPro(): No service for type ApplicationDbContext has been registered

Can you help me?

My code: Startup.cs

    public void ConfigureServices(IServiceCollection services)
    {
        services.AddRazorPages();
        services.AddRazorPages().AddNewtonsoftJson();
        services.AddCoravelPro(typeof(ApplicationDbContext));
    }

    public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
    {
        app.UseRouting();
        app.UseEndpoints(endpoints =>
        {
            endpoints.MapRazorPages();
        });
        app.UseCoravelPro();
    }

    public class ApplicationDbContext : IdentityDbContext, ICoravelProDbContext
    {
        public DbSet<CoravelJobHistory> Coravel_JobHistory { get; set; }
        public DbSet<CoravelScheduledJob> Coravel_ScheduledJobs { get; set; }
        public DbSet<CoravelScheduledJobHistory> Coravel_ScheduledJobHistory { get; set; }
    }

Provide some info on road map please

I love your work, came again after 5 months its still just one step short for production use, sadly.

i need at least #12 and this for coravel pro.
For the latter even a generic "string" argument would suffice for starters. I know a generic input would be a pain for front end.

I checked to see if we could schedule INTO CoravelPro using Coravel, but to no avail.

Could you kindly share your thoughts and plans,

Thank you

Cron expression 'N/A' is malformed.

Using 3.0.0-preview2, I get the following exception when attempting to schedule a job:

Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware: Error: An unhandled exception has occurred while
  executing the request.

System.Exception: Cron expression 'N/A' is malformed.
   at Coravel.Scheduling.Schedule.Cron.CronExpression..ctor(String expression)
   at Coravel.Pro.Features.Scheduling.UseCases.PersistNewScheduledJobCommand.VerifyCronExpression(String cronExpression)
   at Coravel.Pro.Features.Scheduling.UseCases.PersistNewScheduledJobCommand.Save(String typeFullName, IEnumerable`1
      allowedDays, Boolean preventOverlapping, String frequency, String timeZoneString, String specifiedCronExpress)
   at Coravel.Pro.Coravel.Pages.SchedulingModel.OnPostScheduleJob(ScheduleJobRequest model)

Which resulted in the following prompt in the upper right corner:

Whoops!

The follow is a sample setup to reproduce, full project here.

namespace Sample
{
    using Coravel.Invocable;
    using Coravel.Pro;
    using Coravel.Pro.EntityFramework;
    using Microsoft.AspNetCore.Builder;
    using Microsoft.AspNetCore.Hosting;
    using Microsoft.EntityFrameworkCore;
    using Microsoft.Extensions.DependencyInjection;
    using Microsoft.Extensions.Hosting;
    using System;
    using System.Threading.Tasks;

    public class Program
    {
        public static void Main(string[] args)
        {
            CreateHostBuilder(args).Build().Run();
        }

        public static IHostBuilder CreateHostBuilder(string[] args) =>
            Host.CreateDefaultBuilder(args)
                .ConfigureWebHostDefaults(webBuilder =>
                {
                    webBuilder.UseStartup<Startup>();
                });
    }

    public class Startup
    {
        // This method gets called by the runtime. Use this method to add services to the container.
        // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddDbContext<ApplicationDbContext>(options => options.UseInMemoryDatabase(databaseName: "JobBoard"));

            services.AddRazorPages().AddNewtonsoftJson();

            services.AddCoravelPro(typeof(ApplicationDbContext));
        }

        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ApplicationDbContext context)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            context.Database.EnsureCreated();

            app.UseRouting();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapRazorPages();
                endpoints.MapGet("/", async context =>
                {
                    await Task.Run(() => context.Response.Redirect(location: @"/Coravel/Scheduling", permanent: true));
                });
            });

            app.UseCoravelPro();
        }
    }

    public class ApplicationDbContext : DbContext, ICoravelProDbContext
    {
        public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options)
            : base(options)
        { }

        public DbSet<CoravelJobHistory> Coravel_JobHistory { get; set; }
        public DbSet<CoravelScheduledJob> Coravel_ScheduledJobs { get; set; }
        public DbSet<CoravelScheduledJobHistory> Coravel_ScheduledJobHistory { get; set; }
    }

    public class MyFirstInvocable : IInvocable
    {
        public Task Invoke()
        {
            Console.WriteLine("This is my first invocable!");
            return Task.CompletedTask;
        }
    }
}

The workaround is to use a cron expression instead of the menu options.

the default metrics are not showing when using AddJsonOptions

hello,

I was trying the free version and had a problem that the main application would load but there was no text on metric widgets and the application did not find any job.

the problem was solved when I removed JsonOptions from service collection init.

services
                .AddMvc()
                .SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
                .AddJsonOptions(options => options.SerializerSettings.ContractResolver = new DefaultContractResolver());

into:

services
                .AddMvc()
                .SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
               // .AddJsonOptions(options => options.SerializerSettings.ContractResolver = new DefaultContractResolver());

Overlapping

Hi James, using coravelpro in a cluster env I verified an unexpected behaviors. Starting on both node coravel pro interfaces the overlapping is available for different job types but not for the opposite case. The result is the possibility to have 2 jobs running on the same time avoiding in fact the prevent overlapping function.

Load jobs/schedules from database into seperate coravel startup.

I have the current setup and am wondering if there is any way to let many "servers" use the task/jobs from the database.

image

This way I have one management portal that configures the jobs, and each controller loads the jobs from the database instead of hosting the entire management portal themselves. They instead will all have the same information.

If it helps at all my "Controllers" are self hosted signalr servers that the clients connect to and each client returns information back to the controllers. Which I am needing to setup on a schedule. So the schedules aren't running on the management portal website at all but instead each controller.

Let me know if you need any more information.

Is EF 3.1 really needed?

Package restore failed. Rolling back package changes for 'Poseidon.Data'.
Detected package downgrade: Microsoft.Extensions.Configuration from 3.1.5 to 3.1.0. Reference the package directly from the project to select a different version.
Poseidon.Data -> Microsoft.EntityFrameworkCore 3.1.5 -> Microsoft.Extensions.Logging 3.1.5 -> Microsoft.Extensions.Configuration.Binder 3.1.5 -> Microsoft.Extensions.Configuration (>= 3.1.5)
Poseidon.Data -> Microsoft.Extensions.Configuration (>= 3.1.0)

Scheduled Jobs status is success when running

Hi I found a strange behavious using coravel-pro
Having scheduled a job at 1 min, the status is marked as "successful" while the task is still running.
The test is pretty simple. Create a project with un invocable and create a for loop that is called when job is invoked, maybe using a thread.sleep.

As you can see in output is reported the x value loop and in the interface I already have 2 job completed but what is strange is that the first instance is still running ...
Is there anything I didn't' understood well ? thanks MM

Schermata 2021-03-23 alle 15 35 33

Coravel Dashboard gives 401 error

I have been able to run coravel pro. However whenever I try to hit the url :

http://127.0.0.1:5000/coravel/dashboard

it gives me this:

This page isn’t working. If the problem continues, contact the site owner.
HTTP ERROR 401

so what do I need to do in this case?
This project is a webapi project and we also use Swagger that runs fine. I'm using app.UseCoravelPro() as the very first line for IApplicationBuilder

Why Schedule Workers are excluded from Coravel.Pro?

I have been looking around Coravel pros features and can seem to find how can I schedule a job with the UI on a dedicated worker/thread.

I'm amazed that such an amazing and useful feature exists in the open-source package and not the paid version of Coravel.

coravel js file dosent load

Hello
If yous host coravel inside an IIS application like app.domain.com\host\ whene you open dashboard it try to load webpack-bundle.js from root <app.domain.com\webpack-bundle.js> instead of <app.domain.com\host\webpack-bundle.js>
and throw a 404

webpack-bundle.js:1 Failed to load resource: the server responded with a status of 404

Middleware error

We use middleware to log requests to our system. Our middleware class constructor looks like:

public RequestLoggerMiddleware(RequestDelegate next, ILoggerFactory loggerFactory, IConfiguration configuration)
        {
            _next = next;
            _logger = loggerFactory.CreateLogger<RequestLoggerMiddleware>();
            _configuration = configuration;
            _storageAccount =
                CloudStorageAccount.Parse(_configuration.GetConnectionString("BlobStorage"));
        }

public async Task Invoke(HttpContext context, IDbContextFactory<PoseidonDbContext> dbContextFactory){...}

When calling next(), we get the following cast error. Not sure if this is a Coravel error or a Microsoft problem:

 await _next(context);

Unable to cast object of type 'Microsoft.AspNetCore.Mvc.RazorPages.CompiledPageActionDescriptor' to type 'Microsoft.AspNetCore.Mvc.Controllers.ControllerActionDescriptor'.

Threading error

Hi,

I'm setting up CoravelPro to test how it works.

The web UI runs up fine but after clicking around a few times I get "A second operation started on this context before a previous operation completed." See the full error below.

Any suggestions on how to resolve this?

Kind Regards,

Mark

Microsoft.AspNetCore.Routing.EndpointMiddleware: Information: Executed endpoint '/Scheduling'
'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.10\System.Diagnostics.StackTrace.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware: Error: An unhandled exception has occurred while executing the request.

System.InvalidOperationException: A second operation started on this context before a previous operation completed. This is usually caused by different threads using the same instance of DbContext. For more information on how to avoid threading issues with DbContext, see https://go.microsoft.com/fwlink/?linkid=2097913.
at Microsoft.EntityFrameworkCore.Internal.ConcurrencyDetector.EnterCriticalSection()
at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable1.AsyncEnumerator.MoveNextAsync() at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable1 source, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable`1 source, CancellationToken cancellationToken)
at Coravel.Pro.Features.Jobs.UseCases.ScheduledJobHistoryQuery.GetHistory(Int32 page)
at Coravel.Pro.Coravel.Pages.SchedulingModel.OnPostGetHistory(GetHistoryModel model)
at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.ExecutorFactory.GenericTaskHandlerMethod.Convert[T](Object taskAsObject)
at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.ExecutorFactory.GenericTaskHandlerMethod.Execute(Object receiver, Object[] arguments)
at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeHandlerMethodAsync()
at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeNextPageFilterAsync()
at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.Rethrow(PageHandlerExecutedContext context)
at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeInnerFilterAsync()
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|24_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker)
at Microsoft.AspNetCore.Routing.EndpointMiddleware.g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

Unable to Unschedule

When trying to unschedule from the web interface, we have the following error:

Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware: Error: An unhandled exception has occurred while executing the request.

System.MissingMethodException: Method not found: 'System.Threading.Tasks.Task1<!0> Microsoft.EntityFrameworkCore.DbSet1.FindAsync(System.Object[])'.
at Coravel.Pro.Features.Scheduling.UseCases.UnScheduleJobCommand.UnScheduleJob(Int32 id)
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
at Coravel.Pro.Features.Scheduling.UseCases.UnScheduleJobCommand.UnScheduleJob(Int32 id)
at Coravel.Pro.Coravel.Pages.SchedulingModel.OnPostUnschedule(UnscheduleJobRequest model)
at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.ExecutorFactory.GenericTaskHandlerMethod.Convert[T](Object taskAsObject)
at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.ExecutorFactory.GenericTaskHandlerMethod.Execute(Object receiver, Object[] arguments)
at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeHandlerMethodAsync()
at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeNextPageFilterAsync()
at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.Rethrow(PageHandlerExecutedContext context)
at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeInnerFilterAsync()
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|24_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker)
at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext)
at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)

create UI for daily job hour and minute fields

The Daily button in the schedule job editor is limited to setting up jobs at 00:00 UTC. However I would like to setup daily jobs at any time of day.

I would like to propose a UI for entering daily job hour and minute fields. Even better if a Cron expression could be entered.

Authorized access not working

It does not look like the Authorized access class is getting called.

            services.AddScoped<IHasPermission, CoravelHasPermission>();
            
            services.AddRazorPages().AddNewtonsoftJson();
            services.AddCoravelPro(typeof(PoseidonDbContext));
    public class CoravelHasPermission : IHasPermission
    {
        private IAuthorizedUserContext _authorizedUserContext;

        public CoravelHasPermission(IAuthorizedUserContext authorizedUserContext)
        {
            _authorizedUserContext = authorizedUserContext;
        }

        public bool HasPermission(HttpRequest request, ClaimsPrincipal claimsPrincipal)
        {
            var p = request.QueryString.Value;
            return false;
          
        }
    }

.NET Core 3.0 Support

This will potentially remove support for pre-3.0 due to the breaking changes made by MS.

Customization While Scheduling

I am currently evaluating pro, it solves a lot of problems yet falls short in a lot of places, like

  1. one has to publish new invocables to prod environment to create new schedules, needs some dynamic update there.
  2. can't use / schedule same invocable multiple times (more on this later)
  3. can't schedule via portal using 'parameters', one has to code in all details in invocable class.
  4. can't filter scheduler logging to 'warning' and up only. (every second running successful jobs hogging memory/disk and destroying db performance)

I was looking for a solution that would let me schedule web api calls. In coravel's terms, i thought i could create a single "WebApiCaller" invocable, with json parameters (see 3). schedule it "Multiple" times (see 2), and have an MVP to start our scheduling requirements.

Is there a plan to create such support for this in foreseeable future or should i just pass coravel?

DateTime issue

hello,
I've been working on the project and found out the datetime is not setting from the server datetime. how can I handle it? it's not UTC. what time zone is it on?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.