Skip to content

Commit

Permalink
Add simple async get function
Browse files Browse the repository at this point in the history
Also add minor comment
  • Loading branch information
ugyballoons committed Sep 23, 2024
1 parent 063b2d6 commit a3db7ca
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions python/lsst/ts/rubintv/handlers/websocket_notifiers.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ async def send_notification(
) -> None:
datestamp = get_current_day_obs().isoformat()
if messageType is MessageType.CAMERA_PD_BACKDATED and payload:
# use the day_obs in the backdated event, rather than today
datestamp = payload.values()[0].get("day_obs", datestamp)
try:
await websocket.send_json(
Expand Down
11 changes: 11 additions & 0 deletions src/js/modules/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,17 @@ export async function simplePost (url) {
return data
}

/**
* @param {RequestInfo | URL} url
*/
export async function simpleGet (url) {
const res = await fetch(url, {
method: 'GET',
})
const data = await res.text()
return data
}

/**
* @param {string} tagName
* @param {string} className
Expand Down

0 comments on commit a3db7ca

Please sign in to comment.