Skip to content

Commit

Permalink
fix for couple tests, yet more markdown fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremydmiller committed Sep 17, 2024
1 parent ce5b38d commit 12689da
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
3 changes: 1 addition & 2 deletions docs/events/projections/aggregate-projections.md
Original file line number Diff line number Diff line change
Expand Up @@ -714,8 +714,7 @@ Man, that's a mouthful of a title. _Sometimes_, it can be valuable to emit new e
when you first know the new state of the projected aggregate documents. Or maybe what you might want to do is to send
a message for the new state of an updated projection. Here's a couple possible scenarios that might lead you here:

-There's some kind of business logic that can be processed against an aggregate to "decide" what the system
can do next
- There's some kind of business logic that can be processed against an aggregate to "decide" what the system can do next
- You need to send updates about the aggregated projection state to clients via web sockets
- You need to replicate the Marten projection data in a completely different database
- There are business processes that can be kicked off for updates to the aggregated state
Expand Down
3 changes: 3 additions & 0 deletions src/Marten/StoreOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -884,6 +884,9 @@ public PoliciesExpression PartitionMultiTenantedDocuments(Action<PartitioningExp
public PoliciesExpression PartitionMultiTenantedDocumentsUsingMartenManagement(string schemaName)
{
var policy = new MartenManagedTenantListPartitions(_parent, schemaName);

_parent.Storage.Add(policy.Partitions);

_parent._postPolicies.Add(policy);

return this;
Expand Down
12 changes: 10 additions & 2 deletions src/MultiTenancyTests/marten_managed_tenant_id_partitioning.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
Expand All @@ -22,8 +23,15 @@ public async Task InitializeAsync()
{
using var conn = new NpgsqlConnection(ConnectionSource.ConnectionString);
await conn.OpenAsync();
await conn.CreateCommand($"delete from tenants.{MartenManagedTenantListPartitions.TableName}")
.ExecuteNonQueryAsync();
try
{
await conn.CreateCommand($"delete from tenants.{MartenManagedTenantListPartitions.TableName}")
.ExecuteNonQueryAsync();
}
catch (Exception)
{
// being lazy here
}
await conn.CloseAsync();
}

Expand Down

0 comments on commit 12689da

Please sign in to comment.