Skip to content

Commit

Permalink
fix: pass instance of date to utimes method
Browse files Browse the repository at this point in the history
  • Loading branch information
Harminder Virk authored and Harminder Virk committed Jul 29, 2023
1 parent 5b4186f commit 8e5caeb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/drivers/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
* file that was distributed with this source code.
*/

import type { Stats } from 'node:fs'
import { dirname, join } from 'node:path'
import string from '@poppinss/utils/string'
import { MessageBuilder } from '@poppinss/utils'
import { access, mkdir, readFile, rm, writeFile, utimes, stat } from 'node:fs/promises'

import type { SessionData, SessionDriverContract } from '../types.js'
import { Stats } from 'node:fs'

/**
* File driver writes the session data on the file system as. Each session
Expand Down Expand Up @@ -144,6 +144,6 @@ export class FileDriver implements SessionDriverContract {
* persistence store
*/
async touch(sessionId: string): Promise<void> {
await utimes(this.#getFilePath(sessionId), Date.now(), Date.now())
await utimes(this.#getFilePath(sessionId), new Date(), new Date())
}
}

0 comments on commit 8e5caeb

Please sign in to comment.