import { PostgreSQL } from "./types" ; const { one_result } = require ( "../postgres-base" ) ; import { callback } from "awaiting" ; import { reuseInFlight } from "async-await-utils/hof" ; async function _get_remember_me ( db , hash , cache ) { function f ( cb ) { db . _query ( { cache , query : "SELECT account_id, expire FROM remember_me" , where : { "hash = $::CHAR(127)" : hash . slice ( 0 , 127 ) , } , retry_until_success : { max_time : 60000 , start_delay : 10000 } , cb : one_result ( "account_id" , cb ) , } ) ; } return await callback ( f ) ; } export const get_remember_me = reuseInFlight ( _get_remember_me , { createKey : function ( args ) { return args [ 1 ] + args [ 2 ] ; } , } ) ;