import { expire_time } from "@cocalc/util/misc" ; import { PostgreSQL } from "./types" ; import { get_server_settings } from "./server-settings" ; export function pii_retention_to_future < T extends object > ( pii_retention , data ? ) { if ( ! pii_retention ) return ; const future = expire_time ( pii_retention ) ; if ( data != null ) { data . expire = future ; } return future ; } export async function pii_expire < T extends object > ( db , data ? ) { const settings = await get_server_settings ( db ) ; return pii_retention_to_future < T > ( settings . pii_retention , data ) ; }