fix: re-requesting image when all agents are done

This means the agents are no longer parallel. Which will eventually be a
bottleneck, but I need to spend a bit more time on allowing for it to be
parallel, but now is not the time.

TODO: add a ticket
This commit is contained in:
2025-04-27 14:45:23 +01:00
parent 84d66a1c3b
commit a9ecd5818a
2 changed files with 5 additions and 14 deletions

View File

@@ -44,15 +44,6 @@ const getAllValues = (object: object): Array<string> => {
return loop([], object);
};
// On fast connections (or locally), the DB will send the complete update before the image has been fully saved.
// This is because it shouldn't really be an update, and that is hacky but hey. It works.
// The tech debt will be collected eventually.
//
// AND MORE IMPORTANTLY. The fucking AI agents aren't done.
// hhhhhhhhhhhhhhhhhhhhmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
// wait groups.
const BIG_SHAME_TIMEOUT = 5000;
const SearchImageContext = createContext<SearchImageStore>();
export const SearchImageContextProvider: Component<ParentProps> = (props) => {
const [images, { refetch }] = createResource(() =>
@@ -68,7 +59,7 @@ export const SearchImageContextProvider: Component<ParentProps> = (props) => {
<SearchImageContext.Provider
value={{
images,
onRefetchImages: () => setTimeout(refetch, BIG_SHAME_TIMEOUT),
onRefetchImages: refetch,
}}
>
{props.children}