0.0.4 - fix simulated load
This commit is contained in:
parent
e68999c06b
commit
126e90084e
4 changed files with 10 additions and 4 deletions
|
|
@ -1,5 +1,9 @@
|
||||||
# HTMX-PATTERNS CHANGELOG
|
# HTMX-PATTERNS CHANGELOG
|
||||||
|
|
||||||
|
## 0.0.4
|
||||||
|
|
||||||
|
* fix simulated load need asyncio.sleep
|
||||||
|
|
||||||
## 0.0.3
|
## 0.0.3
|
||||||
|
|
||||||
* fix docker `ENV=prod`
|
* fix docker `ENV=prod`
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# SPDX-FileCopyrightText: 2024-present Waylon S. Walker <waylon@waylonwalker.com>
|
# SPDX-FileCopyrightText: 2024-present Waylon S. Walker <waylon@waylonwalker.com>
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: MIT
|
# SPDX-License-Identifier: MIT
|
||||||
__version__ = "0.0.3"
|
__version__ = "0.0.4"
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import asyncio
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from fastapi import APIRouter
|
from fastapi import APIRouter
|
||||||
|
|
@ -22,7 +23,7 @@ async def infinite(request: Request, page: int = 1, n: int = 10):
|
||||||
persons = [PersonFactory.build() for _ in range(n)]
|
persons = [PersonFactory.build() for _ in range(n)]
|
||||||
|
|
||||||
if request.state.prefers_partial:
|
if request.state.prefers_partial:
|
||||||
time.sleep(1)
|
await asyncio.sleep(0.5)
|
||||||
return config.templates.TemplateResponse(
|
return config.templates.TemplateResponse(
|
||||||
"infinite/persons_partial.html",
|
"infinite/persons_partial.html",
|
||||||
{
|
{
|
||||||
|
|
|
||||||
5
justfile
5
justfile
|
|
@ -2,8 +2,9 @@ default:
|
||||||
@just --list
|
@just --list
|
||||||
|
|
||||||
build-image:
|
build-image:
|
||||||
podman build -t docker.io/waylonwalker/htmx-patterns-waylonwalker-com:0.0.3 .
|
podman build -t docker.io/waylonwalker/htmx-patterns-waylonwalker-com:$(hatch version) .
|
||||||
|
|
||||||
push-image:
|
push-image:
|
||||||
podman push docker.io/waylonwalker/htmx-patterns-waylonwalker-com:0.0.3
|
podman push docker.io/waylonwalker/htmx-patterns-waylonwalker-com:$(hatch version)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue