Skip to content

yyavci/nop-task-scheduler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NopCommerce Task Scheduler

What is it?

Nopcommerce does only support timer based tasks like every n seconds. This app will fix that missing feature.

It is working fine using Nopcommerce 4.2 version. should function for other versions too. (might need small modifications)

This is my "hello world" app for go language.

Setup

  • Set your "CONN_STR" environment variable or "ConnectionString" field in your config.json file.
  • Add "CronExpression" column to your "ScheduleTask" table.
ALTER TABLE [ScheduleTask] 
	ADD [CronExpression] nvarchar(512) NULL;
  • Add return statement at the beginning of your "Nop.Services/Tasks/TaskManager.Initialize()" method like below. (or make it configurable)
public void Initialize()
{
    //here
    return;

    _taskThreads.Clear();

    var taskService = EngineContext.Current.Resolve<IScheduleTaskService>();
    
    .
    .
    .
}

Build & Run

You can use following command in your terminal.

# build app
go build ./cmd/task-scheduler/

# run
./task-scheduler

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages