@emarketeer/ts-microservice-commons 10.4.0 → 10.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -536,11 +536,13 @@ function getHandlerBundlerPath() {
536
536
  * - Otherwise bundles `entryFile` via the project handler bundler at synth
537
537
  * time, with overrides applied on top of the defaults.
538
538
  *
539
- * An explicit `assetHash` is derived from the entry path + bundling overrides.
540
- * Without it, multiple handlers under the same source directory (the common
541
- * `src/handlers/` layout) would share an asset CDK would run `tryBundle`
542
- * once and reuse that asset for every other lambda, silently dropping
543
- * per-function overrides. The explicit hash gives each handler a unique asset.
539
+ * An explicit `assetHash` is derived per call from the entry path, bundling
540
+ * overrides, and a synth-time timestamp. The entry path is required so that
541
+ * multiple handlers under the same source directory (the common
542
+ * `src/handlers/` layout) don't collapse into one asset without it, CDK
543
+ * would run `tryBundle` once and silently reuse the same code for every
544
+ * lambda. The timestamp forces a fresh asset on every synth so each deploy
545
+ * uploads a clean rebuild rather than reusing a cached upload.
544
546
  */
545
547
  function resolveLambdaCode(options) {
546
548
  if (options.codePath) {
@@ -559,6 +561,7 @@ function resolveLambdaCode(options) {
559
561
  const hash = crypto.createHash('sha256')
560
562
  .update(entry)
561
563
  .update(JSON.stringify(overrides ?? {}))
564
+ .update(String(Date.now()))
562
565
  .digest('hex');
563
566
  const assetHash = `${handlerName}-${hash}`;
564
567
  return awsLambda.Code.fromAsset(path__namespace.dirname(entry), {