Remove unnecessary async/await from method

Signed-off-by: Christina Ying Wang <christina@balena.io>
This commit is contained in:
Christina Ying Wang 2023-06-14 18:06:24 -07:00
parent 6e6f79c71d
commit 9e249e6ae8
3 changed files with 5 additions and 5 deletions

View File

@ -189,9 +189,9 @@ export class App {
return steps;
}
public async stepsToRemoveApp(
public stepsToRemoveApp(
state: Omit<UpdateState, 'availableImages'> & { keepVolumes: boolean },
): Promise<CompositionStep[]> {
): CompositionStep[] {
if (Object.keys(this.services).length > 0) {
return Object.values(this.services).map((service) =>
generateStep('kill', { current: service }),

View File

@ -221,7 +221,7 @@ export async function inferNextSteps(
// For apps in the current state but not target, we call their "destructor"
for (const id of onlyCurrent) {
steps = steps.concat(
await currentApps[id].stepsToRemoveApp({
currentApps[id].stepsToRemoveApp({
keepVolumes,
downloading,
containerIds: containerIdsByAppId[id],

View File

@ -262,12 +262,12 @@ describe('compose/app', () => {
.that.deep.includes({ serviceName: 'test' });
});
it('should correctly infer to remove an app volumes when the app is being removed', async () => {
it('should correctly infer to remove an app volumes when the app is being removed', () => {
const current = createApp({
volumes: [Volume.fromComposeObject('test-volume', 1, 'deadbeef')],
});
const steps = await current.stepsToRemoveApp(defaultContext);
const steps = current.stepsToRemoveApp(defaultContext);
const [removeVolumeStep] = expectSteps('removeVolume', steps);
expect(removeVolumeStep).to.have.property('current').that.deep.includes({