From 5236ae1e065dc3a5eeb3d88f92749fd5565426f7 Mon Sep 17 00:00:00 2001 From: Lyncoln Date: Mon, 26 Oct 2026 10:04:18 -0400 Subject: [PATCH] Reduced requests by removing refresh token from operations and loading token data in the first step of an operation --- plugins/rmass/actions/checkavailable.py | 9 +++++++++ plugins/rmass/actions/pullmessagelist.py | 8 ++++++++ plugins/rmass/actions/refresh_tokens.py | 2 +- plugins/rmass/operations/rmassmessagepush.py | 15 +++++++++++---- plugins/rmass/operations/setavailable.py | 1 - 5 files changed, 29 insertions(+), 6 deletions(-) diff --git a/plugins/rmass/actions/checkavailable.py b/plugins/rmass/actions/checkavailable.py index 4646511..09ae340 100644 --- a/plugins/rmass/actions/checkavailable.py +++ b/plugins/rmass/actions/checkavailable.py @@ -1,3 +1,5 @@ +import os + name = "Availability check" kind = "action" @@ -32,3 +34,10 @@ prints = { recoverPolicy = { KeyError: [] } + +loaddata = [ + "access_token", + "refresh_token", +] + +savepath = os.environ["TOKEN_STORE"] \ No newline at end of file diff --git a/plugins/rmass/actions/pullmessagelist.py b/plugins/rmass/actions/pullmessagelist.py index d04fab3..78a9ae0 100644 --- a/plugins/rmass/actions/pullmessagelist.py +++ b/plugins/rmass/actions/pullmessagelist.py @@ -1,3 +1,5 @@ +import os + name = "Get message list" kind = "action" @@ -33,3 +35,9 @@ outputs = { "emails": "emails" } +loaddata = [ + "access_token", + "refresh_token", +] + +savepath = os.environ["TOKEN_STORE"] \ No newline at end of file diff --git a/plugins/rmass/actions/refresh_tokens.py b/plugins/rmass/actions/refresh_tokens.py index d9c8d57..c492061 100644 --- a/plugins/rmass/actions/refresh_tokens.py +++ b/plugins/rmass/actions/refresh_tokens.py @@ -51,7 +51,7 @@ recoverPolicy = { ], } -sleeptime = 120 +sleeptime = 105 #saverow = { # "table": "credentials", diff --git a/plugins/rmass/operations/rmassmessagepush.py b/plugins/rmass/operations/rmassmessagepush.py index f64dccb..23b1415 100644 --- a/plugins/rmass/operations/rmassmessagepush.py +++ b/plugins/rmass/operations/rmassmessagepush.py @@ -1,4 +1,4 @@ -from plugins.rmass.actions import rmassmessagepush, synapsegetroomalias, refresh_tokens, synapsegetlastmessage, getrmassconversation +from plugins.rmass.actions import rmassmessagepush, synapsegetroomalias, refresh_tokens, synapsegetlastmessage, getrmassconversation, synapsegetattachment, getrmassattachmenturl, synapseattachmenttormass, getrmassattachmentid, rmassattachmentpush name = "RMASS Message Push" @@ -6,13 +6,20 @@ kind = "recursiveset" recursiveset = { "source": "events", + #"retain": False, "outputlabel": "outmessageitem", "actions": [ - synapsegetroomalias, - refresh_tokens, + #refresh_tokens, + synapsegetroomalias, rmassmessagepush, synapsegetlastmessage, - getrmassconversation + synapsegetattachment, + getrmassattachmenturl, + synapseattachmenttormass, + getrmassattachmentid, + rmassattachmentpush, + synapsegetlastmessage, + getrmassconversation, ], } diff --git a/plugins/rmass/operations/setavailable.py b/plugins/rmass/operations/setavailable.py index 1d9129e..c3c06eb 100644 --- a/plugins/rmass/operations/setavailable.py +++ b/plugins/rmass/operations/setavailable.py @@ -5,7 +5,6 @@ name = "Set Available" kind = "operation" actions = [ - refresh_tokens, checkavailable, setavailable, ]