File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,9 @@ def _generate_token(
41
41
token = InstallationToken ._create_installation_access_token (
42
42
jwt_token , installation_id
43
43
).json ()["token" ]
44
- expiration = datetime .now (tz = UTC ) + InstallationToken .GITHUB_TOKEN_LIFETIME
44
+ expiration = (
45
+ datetime .now (tz = UTC ) + InstallationToken .GITHUB_TOKEN_LIFETIME * 0.8
46
+ )
45
47
46
48
return token , expiration
47
49
@@ -72,7 +74,7 @@ def get_as_secret(self) -> str:
72
74
return f"%(secret:github-token-{ self .installation_id } )"
73
75
74
76
def verify (self ) -> None :
75
- if datetime .now (tz = UTC ) - self . expiration > self .GITHUB_TOKEN_LIFETIME * 0.8 :
77
+ if datetime .now (tz = UTC ) > self .expiration :
76
78
self .token , self .expiration = InstallationToken ._generate_token (
77
79
self .jwt_token , self .installation_id
78
80
)
You can’t perform that action at this time.
0 commit comments