Skip to content
Merged
Prev Previous commit
Next Next commit
use run util complete
Signed-off-by: Rob Howley <howley.robert@gmail.com>
  • Loading branch information
robhowley committed Oct 23, 2024
commit afaa4120107e9eddb3e9acd781a57021b5ceda4b
4 changes: 2 additions & 2 deletions sdk/python/feast/feature_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ def async_refresh():
@asynccontextmanager
async def lifespan(app: FastAPI):
async_refresh()
# await store.initialize()
await store.initialize()
Comment thread
robhowley marked this conversation as resolved.
yield
stop_refresh()
# await store.close()
await store.close()
Comment on lines +103 to +107
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can create and cleanup resources as part of the feature server lifespan

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove this and let's rerun the integration test? Or maybe create a separate branch without it?


app = FastAPI(lifespan=lifespan)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ def python_fs_client(environment, universal_data_sources, request):
feast_objects.extend([driver(), customer(), location()])
fs.apply(feast_objects)
fs.materialize(environment.start_date, environment.end_date)
asyncio.run(fs.initalize())
loop = asyncio.get_event_loop()
loop.run_until_complete(fs.initalize())
client = TestClient(get_app(fs))
yield client
asyncio.run(fs.close())
loop.run_until_complete(fs.close())