Skip to content

Commit

Permalink
Use built-in reload method to update small_class value.
Browse files Browse the repository at this point in the history
  • Loading branch information
Carifio24 committed Dec 3, 2024
1 parent 2032d1b commit b9f8062
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,10 +350,10 @@ export async function createClass(options: CreateClassOptions): Promise<CreateCl
});

// Another piece of Hubble-specific functionality
// Note that we need to re-query for the class as the virtual `small_class`
// column is only evaluted on a read (not the insert that we just did)
const createdClass = await findClassById(cls.id);
if (createdClass && (createdClass.asynchronous || createdClass.small_class)) {
// Note that we need to reload the class so that the virtual `small_class`
// column has its value populated
await cls.reload();
if (cls.asynchronous || cls.small_class) {
await addClassToMergeGroup(cls.id);
}

Expand Down

0 comments on commit b9f8062

Please sign in to comment.