Skip to content

Commit

Permalink
cron job daily
Browse files Browse the repository at this point in the history
  • Loading branch information
adrienZ committed Sep 3, 2024
1 parent 110f03e commit 444b30e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default defineNuxtModule<ModuleOptions>({
nitroConfig.scheduledTasks = {
...nitroConfig.scheduledTasks,
// @daily https://crontab.guru/#00_00_*_*_*
"* * * * *": ["slip:db:expired-sessions"],
"00 00 * * *": ["slip:db:expired-sessions"],
};
});

Expand Down
15 changes: 7 additions & 8 deletions src/runtime/core/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import { OAuthAccountsRepository } from "./repositories/OAuthAccountsRepository"
const defaultIdGenerationMethod = () => generateRandomString(15, alphabet("a-z", "A-Z", "0-9"));

export class SlipAuthCore {
#db: checkDbAndTablesParameters[0];
#orm: ReturnType<typeof drizzleIntegration>;
#tableNames: tableNames;
#sessionMaxAge: number;
#repos: {
readonly #db: checkDbAndTablesParameters[0];
readonly #orm: ReturnType<typeof drizzleIntegration>;
readonly #tableNames: tableNames;
readonly #sessionMaxAge: number;
readonly #repos: {
users: UsersRepository
sessions: SessionsRepository
oAuthAccounts: OAuthAccountsRepository
Expand All @@ -24,9 +24,8 @@ export class SlipAuthCore {
#createRandomUserId: () => string;
#createRandomSessionId: () => string;

schemas: SchemasMockValue;

hooks = createSlipHooks();
readonly schemas: SchemasMockValue;
readonly hooks = createSlipHooks();

constructor(
providedDatabase: checkDbAndTablesParameters[0],
Expand Down

0 comments on commit 444b30e

Please sign in to comment.