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:
Lucy
2026-01-18 13:12:24 -05:00
committed by GitHub
parent 5fd3a35711
commit b6686d86db
2 changed files with 24 additions and 18 deletions
+2 -2
View File
@@ -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()