mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-30 00:29:02 +01:00
Adds fire_and_forget to /datum/http_request (#94891)
## About The Pull Request This adds `/datum/http_request/proc/fire_and_forget()`, which wraps `rustg_http_request_fire_and_forget`, used for http requests that you just send and don't care about the response. I've changed `send2adminchat_webhook` to use this, as it didn't care about the response at all. Also added a return type hint to `into_response()`, and did some minor cleanup on some assorted `/datum/http_request` code. ## Why It's Good For The Game `fire_and_forget` is very useful because it prevents http request jobs from forever taking up memory if you never call `is_complete()` ## Changelog No user-facing changes.
This commit is contained in:
@@ -339,9 +339,9 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new)
|
||||
// send2chat(new /datum/tgs_message_conent("[initiator_ckey] | [message_content]"), "ahelp", TRUE)
|
||||
var/list/headers = list()
|
||||
headers["Content-Type"] = "application/json"
|
||||
var/datum/http_request/request = new()
|
||||
var/datum/http_request/request = new
|
||||
request.prepare(RUSTG_HTTP_METHOD_POST, webhook, json_encode(webhook_info), headers, "tmp/response.json")
|
||||
request.begin_async()
|
||||
request.fire_and_forget()
|
||||
|
||||
/datum/admin_help/Destroy()
|
||||
RemoveActive()
|
||||
|
||||
Reference in New Issue
Block a user