Skip to content

Commit

Permalink
refactor: add cache enable on server start
Browse files Browse the repository at this point in the history
  • Loading branch information
Murzbul committed Nov 25, 2023
1 parent d2d0ea0 commit c9fd27d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ Common structures found within this project are:
- Business logic independent of the HTTP and persistence libraries.
- Supabase integration middleware.

## Docs
[POSTMAN Documentation](https://documenter.getpostman.com/view/22552353/2s9YeBftt9)

## License

**NExp** is [MIT licensed](LICENSE).
9 changes: 7 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,13 @@ void (async() =>
await createConnection.create();

// Create Cache connection
const cache: ICacheDataAccess = container.resolve(REPOSITORIES.ICacheDataAccess);
await cache.cleanAll();
let cache: ICacheDataAccess;

if (config.cache.enable)
{
cache = container.resolve(REPOSITORIES.ICacheDataAccess);
await cache.cleanAll();
}

// Set EventHandler and all events
const eventHandler = EventHandler.getInstance();
Expand Down

0 comments on commit c9fd27d

Please sign in to comment.