Skip to content

Commit

Permalink
Merge pull request #1071 from SEKOIA-IO/lv/fix_google_module_time_bug
Browse files Browse the repository at this point in the history
Fix Google Workspace bug
  • Loading branch information
squioc authored Aug 8, 2024
2 parents b1cfc0c + 8a8060c commit 4465747
Show file tree
Hide file tree
Showing 6 changed files with 686 additions and 581 deletions.
2 changes: 1 addition & 1 deletion Google/connector_google_reports.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
},
"start_time": {
"type": "integer",
"description": "The number of days from which events should be queried.",
"description": "The number of hours from which events should be queried.",
"default": 1
},
"chunk_size": {
Expand Down
11 changes: 9 additions & 2 deletions Google/google_module/google_reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,17 @@ def stepper(self):
most_recent_date_seen = six_months_ago

timeshift = timedelta(minutes=self.configuration.timedelta)

start = most_recent_date_seen
end = now - timeshift # set the end of the period to the now minus the temporal shift
if start > end:
# this is a case when most_recent_date_seen > now() - timedelta
start = most_recent_date_seen - timeshift

return TimeStepper(
self,
most_recent_date_seen,
now - timeshift, # Set the end of the period to the now minus the temporal shift
start,
end,
timedelta(seconds=self.configuration.frequency),
timeshift,
)
Expand Down
2 changes: 1 addition & 1 deletion Google/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,5 @@
"name": "Google",
"uuid": "4f682a9e-9a25-43a5-8a48-cd9bd7fade7e",
"slug": "google",
"version": "1.20.8"
"version": "1.20.9"
}
Loading

0 comments on commit 4465747

Please sign in to comment.