Add bin and edit workflow
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 9s

This commit is contained in:
2026-09-16 13:11:16 -06:00
parent c8ac4fcae5
commit 4cee170d66
17576 changed files with 895740 additions and 2 deletions
@@ -0,0 +1,56 @@
module Typhoeus
class Hydra
# This module handles the GET request memoization
# on the hydra side. Memoization needs to be turned
# on:
# Typhoeus.configure do |config|
# config.memoize = true
# end
#
# @api private
module Memoizable
# Return the memory.
#
# @example Return the memory.
# hydra.memory
#
# @return [ Hash ] The memory.
def memory
@memory ||= {}
end
# Overrides add in order to check before if request
# is memoizable and already in memory. If thats the case,
# super is not called, instead the response is set and
# the on_complete callback called.
#
# @example Add the request.
# hydra.add(request)
#
# @param [ Request ] request The request to add.
#
# @return [ Request ] The added request.
def add(request)
if request.memoizable? && memory.has_key?(request)
response = memory[request]
request.finish(response, true)
dequeue
else
super
end
end
# Overrides run to make sure the memory is cleared after
# each run.
#
# @example Run hydra.
# hydra.run
def run
super
memory.clear
end
end
end
end