Clear final M0 bugs on master (T-5 verified, T-12, T-15, T-17)

This commit is contained in:
Boki 2026-11-27 16:42:43 -05:00
parent ade0a3ef1d
commit 2ea7316af6
7 changed files with 148 additions and 17 deletions

View file

@ -44,11 +44,21 @@ export function Operation(
if (!constructor.__operations) {
constructor.__operations = [];
}
constructor.__operations.push({
name,
method: String(methodName),
batch: options?.batch,
});
const methodKey = String(methodName);
const existing = constructor.__operations.find(
op => op.name === name && op.method === methodKey
);
if (existing) {
if (options?.batch !== undefined && existing.batch === undefined) {
existing.batch = options.batch;
}
} else {
constructor.__operations.push({
name,
method: methodKey,
batch: options?.batch,
});
}
return descriptor;
};
@ -82,11 +92,17 @@ export function QueueSchedule(
if (!constructor.__schedules) {
constructor.__schedules = [];
}
constructor.__schedules.push({
operation: String(methodName),
cronPattern,
...options,
});
const operationKey = String(methodName);
const existingSchedule = constructor.__schedules.find(
s => s.operation === operationKey && s.cronPattern === cronPattern
);
if (!existingSchedule) {
constructor.__schedules.push({
operation: operationKey,
cronPattern,
...options,
});
}
return descriptor;
};