Skip to Content
nyx logonyx guide

Repository

See in:
DefaultScheduleRepositoryGitHub
ScheduleRepositoryGitHub
Reading time:1 min read

The ScheduleRepository is responsible for storing all the currently registered schedules.

When to override

✅ Override if you want to...❌ Don't override if you want to...
Change schedule persistence (e.g., database instead of in-memory).Adjust schedule execution or job lifecycle. Use ScheduleExecutor or ScheduleJobAdapter instead.
Enforce custom consistency/uniqueness rules at storage level (e.g., dedup by business key).Change middleware flow or pre-execution checks. That belongs to ScheduleMiddlewareList.
Support multi-tenant partitioning or custom query/filter capabilities in storage.Change manager event orchestration. That belongs to ScheduleManager.

Overriding

Creation

Create a custom schedule repository by either:

import {  } from '@nyx-discord/djs';

class  extends  {
  public () {
    // Custom logic
  }
}

Registration

Create it and set it to the ScheduleManager.

class  extends  {
  /** Your overrides */
}

.().(.());

The DefaultScheduleRepository.create() method instantiates your custom repository, not the default one.

Edit on GitHub

Last updated on

On this page