Moved token refresh into its worn operation for process registry compatibility
This commit is contained in:
+7
-3
@@ -5,7 +5,8 @@ import os
|
|||||||
from core.server.server import startServer
|
from core.server.server import startServer
|
||||||
from core.execution.createthread import buildThread
|
from core.execution.createthread import buildThread
|
||||||
from plugins.rmass.monitors import rmassmonitor
|
from plugins.rmass.monitors import rmassmonitor
|
||||||
from plugins.rmass.actions import refresh_tokens
|
#from plugins.rmass.actions import refresh_tokens
|
||||||
|
from plugins.rmass.operations import token_update
|
||||||
|
|
||||||
from core.console import console
|
from core.console import console
|
||||||
from rich.logging import RichHandler
|
from rich.logging import RichHandler
|
||||||
@@ -28,11 +29,14 @@ import login
|
|||||||
import synapsemessagepush
|
import synapsemessagepush
|
||||||
|
|
||||||
rmassmonitor.mode = "continuous"
|
rmassmonitor.mode = "continuous"
|
||||||
refresh_tokens.mode = "continuous"
|
token_update.mode = "continuous"
|
||||||
|
#refresh_tokens.mode = "continuous"
|
||||||
|
|
||||||
thread = buildThread(rmassmonitor)
|
thread = buildThread(rmassmonitor)
|
||||||
|
|
||||||
thread = buildThread(refresh_tokens)
|
#thread = buildThread(refresh_tokens)
|
||||||
|
|
||||||
|
thread = buildThread(token_update)
|
||||||
|
|
||||||
thread = threading.Thread(
|
thread = threading.Thread(
|
||||||
target=startServer,
|
target=startServer,
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ name = "Token refresh"
|
|||||||
|
|
||||||
kind = "action"
|
kind = "action"
|
||||||
|
|
||||||
|
alias = "refresh_tokens"
|
||||||
|
|
||||||
showstatus = True
|
showstatus = True
|
||||||
|
|
||||||
method = "GET"
|
method = "GET"
|
||||||
@@ -44,6 +46,15 @@ outputs = {
|
|||||||
"refresh_token": "refreshToken",
|
"refresh_token": "refreshToken",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
responsepolicy = [
|
||||||
|
{
|
||||||
|
"statuscode": 403,
|
||||||
|
"print": "Refreshing stale tokens...",
|
||||||
|
"execute": login,
|
||||||
|
"response_update": False,
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
recoverPolicy = {
|
recoverPolicy = {
|
||||||
FileNotFoundError: [
|
FileNotFoundError: [
|
||||||
getcsrf,
|
getcsrf,
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
import os
|
||||||
|
|
||||||
|
from plugins.rmass.actions import refresh_tokens
|
||||||
|
|
||||||
|
name = "Token Refresh Operation"
|
||||||
|
|
||||||
|
kind = "operation"
|
||||||
|
|
||||||
|
actions = [
|
||||||
|
refresh_tokens,
|
||||||
|
]
|
||||||
|
|
||||||
|
sleeptime = os.environ.get("TOKEN_REFRESH_RATE", 105)
|
||||||
Reference in New Issue
Block a user