Skip to content

Commit

Permalink
custom warmup
Browse files Browse the repository at this point in the history
  • Loading branch information
drhelius committed Aug 16, 2023
1 parent bebc130 commit 80275ae
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/com/drhelius/WarmupFunctions.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import com.microsoft.azure.functions.ExecutionContext;
import com.microsoft.azure.functions.HttpMethod;
import com.microsoft.azure.functions.HttpRequestMessage;
import com.microsoft.azure.functions.HttpResponseMessage;
import com.microsoft.azure.functions.HttpStatus;
import com.microsoft.azure.functions.annotation.AuthorizationLevel;
import com.microsoft.azure.functions.annotation.FunctionName;
import com.microsoft.azure.functions.annotation.HttpTrigger;
Expand All @@ -20,7 +22,7 @@ public void warmup( @WarmupTrigger Object warmupContext, ExecutionContext contex
}

@FunctionName("CustomWarmup")
public void CustomWarmup( @HttpTrigger(
public HttpResponseMessage CustomWarmup( @HttpTrigger(
name = "req",
methods = {HttpMethod.GET, HttpMethod.POST},
authLevel = AuthorizationLevel.ANONYMOUS,
Expand All @@ -31,6 +33,8 @@ public void CustomWarmup( @HttpTrigger(
context.getLogger().info("## CustomWarmup warming up 🌞🌞🌞");
LazyClient.getInstance().run();
context.getLogger().info("## CustomWarmup is warm 🌞🌞🌞");

return request.createResponseBuilder(HttpStatus.OK).body("Warm").build();
}
}

0 comments on commit 80275ae

Please sign in to comment.