move getExpiration to upload-artifact

This commit is contained in:
Bethany
2023-08-09 13:12:30 -07:00
parent 4b219f79f3
commit 4dda3ab8a0
2 changed files with 13 additions and 14 deletions

View File

@@ -1,6 +1,5 @@
import {getRuntimeToken} from './config'
import jwt_decode from 'jwt-decode'
import {Timestamp} from '../../generated'
export interface BackendIds {
workflowRunBackendId: string
@@ -64,14 +63,3 @@ export function getBackendIdsFromToken(): BackendIds {
throw InvalidJwtError
}
export function getExpiration(retentionDays?: number): Timestamp | undefined {
if (!retentionDays) {
return undefined
}
const expirationDate = new Date()
expirationDate.setDate(expirationDate.getDate() + retentionDays)
return Timestamp.fromDate(expirationDate)
}