Skip to content

Commit 44712a7

Browse files
authored
Revert "add warmup context (#154)" (#157)
This reverts commit bd11d48.
1 parent 3d6797a commit 44712a7

File tree

3 files changed

+8
-31
lines changed

3 files changed

+8
-31
lines changed

azure/functions/_abc.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,6 @@ def message(self) -> str:
4747
pass
4848

4949

50-
class WarmUpContext(abc.ABC):
51-
"""Warmup context object."""
52-
pass
53-
54-
5550
class TraceContext(abc.ABC):
5651
"""Trace context object."""
5752

@@ -131,12 +126,6 @@ def retry_context(self) -> RetryContext:
131126
"""Context for retries to the function."""
132127
pass
133128

134-
@property
135-
@abc.abstractmethod
136-
def warmup_context(self) -> WarmUpContext:
137-
"""Context for warmup to the function."""
138-
pass
139-
140129

141130
class HttpRequest(abc.ABC):
142131
"""HTTP request object."""

tests/test_http_asgi.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import unittest
66

77
import azure.functions as func
8-
from azure.functions._abc import TraceContext, RetryContext, WarmUpContext
8+
from azure.functions._abc import TraceContext, RetryContext
99
from azure.functions._http_asgi import (
1010
AsgiMiddleware
1111
)
@@ -114,17 +114,15 @@ def _generate_func_context(
114114
function_name='httptrigger',
115115
function_directory='/home/roger/wwwroot/httptrigger',
116116
trace_context=TraceContext,
117-
retry_context=RetryContext,
118-
warmup_context=WarmUpContext
117+
retry_context=RetryContext
119118
) -> func.Context:
120119
class MockContext(func.Context):
121-
def __init__(self, ii, fn, fd, tc, rc, wc):
120+
def __init__(self, ii, fn, fd, tc, rc):
122121
self._invocation_id = ii
123122
self._function_name = fn
124123
self._function_directory = fd
125124
self._trace_context = tc
126125
self._retry_context = rc
127-
self._warmup_context = wc
128126

129127
@property
130128
def invocation_id(self):
@@ -146,12 +144,8 @@ def trace_context(self):
146144
def retry_context(self):
147145
return self._retry_context
148146

149-
@property
150-
def warmup_context(self):
151-
return self._warmup_context
152-
153147
return MockContext(invocation_id, function_name, function_directory,
154-
trace_context, retry_context, warmup_context)
148+
trace_context, retry_context)
155149

156150
def test_middleware_calls_app(self):
157151
app = MockAsgiApplication()

tests/test_http_wsgi.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from io import StringIO, BytesIO
66

77
import azure.functions as func
8-
from azure.functions._abc import TraceContext, RetryContext, WarmUpContext
8+
from azure.functions._abc import TraceContext, RetryContext
99
from azure.functions._http import HttpResponseHeaders
1010
from azure.functions._http_wsgi import (
1111
WsgiRequest,
@@ -223,17 +223,15 @@ def _generate_func_context(
223223
function_name='httptrigger',
224224
function_directory='/home/roger/wwwroot/httptrigger',
225225
trace_context=TraceContext,
226-
retry_context=RetryContext,
227-
warmup_context=WarmUpContext
226+
retry_context=RetryContext
228227
) -> func.Context:
229228
class MockContext(func.Context):
230-
def __init__(self, ii, fn, fd, tc, rc, wc):
229+
def __init__(self, ii, fn, fd, tc, rc):
231230
self._invocation_id = ii
232231
self._function_name = fn
233232
self._function_directory = fd
234233
self._trace_context = tc
235234
self._retry_context = rc
236-
self._warmup_context = wc
237235

238236
@property
239237
def invocation_id(self):
@@ -255,12 +253,8 @@ def trace_context(self):
255253
def retry_context(self):
256254
return self._retry_context
257255

258-
@property
259-
def warmup_context(self):
260-
return self._warmup_context
261-
262256
return MockContext(invocation_id, function_name, function_directory,
263-
trace_context, retry_context, warmup_context)
257+
trace_context, retry_context)
264258

265259
def _generate_wsgi_app(self,
266260
status='200 OK',

0 commit comments

Comments
 (0)