Skip to content
This repository has been archived by the owner on Feb 2, 2022. It is now read-only.

Commit

Permalink
Merge pull request #42 from imranmomin/develop
Browse files Browse the repository at this point in the history
3.0.2
  • Loading branch information
imranmomin authored Jun 19, 2019
2 parents f96bca8 + c104805 commit a292947
Show file tree
Hide file tree
Showing 9 changed files with 1,315 additions and 1,314 deletions.
2 changes: 2 additions & 0 deletions Hangfire.AzureDocumentDB.sln.DotSettings
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=LocalFunctions/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateStaticFields/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateStaticReadonly/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
<s:Boolean x:Key="/Default/UserDictionary/Words/=azuredocumentdb/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=documentdb/@EntryIndexedValue">True</s:Boolean>
Expand Down
1,099 changes: 547 additions & 552 deletions Hangfire.AzureDocumentDB/DocumentDbConnection.cs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Hangfire.AzureDocumentDB/DocumentDbDistributedLock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ private void Acquire(TimeSpan timeout)
System.Threading.Thread.Sleep(2000);
}

logger.Trace($"Acquired lock for {resource} in {acquireStart.Elapsed.TotalSeconds} seconds");
logger.Trace($"Acquired lock for {resource} in {acquireStart.Elapsed.TotalMilliseconds:#.##} ms");
}

}
Expand Down
971 changes: 484 additions & 487 deletions Hangfire.AzureDocumentDB/DocumentDbMonitoringApi.cs

Large diffs are not rendered by default.

154 changes: 77 additions & 77 deletions Hangfire.AzureDocumentDB/Hangfire.AzureDocumentDB.csproj
Original file line number Diff line number Diff line change
@@ -1,78 +1,78 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net461;netstandard2.0</TargetFrameworks>
<ProductName>Hangfire.AzureDocumentDB</ProductName>
<Title>Hangfire.AzureDocumentDB</Title>
<Company>Hangfire.AzureDocumentDB</Company>
<Authors>Imran Momin</Authors>
<PackageLicense>https://github.com/imranmomin/hangfire.azuredocumentdb/blob/master/LICENSE</PackageLicense>
<PackageProjectUrl>https://github.com/imranmomin/hangfire.azuredocumentdb</PackageProjectUrl>
<Copyright>Copyright 2018</Copyright>
<PackageTags>Hangfire Azure DocumentDB Cosmos</PackageTags>
<Description>This package adds support to Microsoft Azure DocumentDB for Hangfire</Description>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<PackageVersion>1.0.1</PackageVersion>
<Version>2.0.0</Version>
<FileVersion>2.0.0.0</FileVersion>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<RootNamespace>Hangfire.Azure</RootNamespace>
<TypeScriptToolsVersion>Latest</TypeScriptToolsVersion>
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<DefineConstants>NETCORE;NETSTANDARD;NETSTANDARD2_0</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net461'">
<DefineConstants>NET461;NETFULL</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net461|AnyCPU'">
<DocumentationFile>bin\Release\net461\Hangfire.AzureDocumentDB.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|netstandard2.0|AnyCPU'">
<DocumentationFile>bin\Release\netstandard2.0\Hangfire.AzureDocumentDB.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<None Remove="node_modules\**" />
<None Remove="package-lock.json" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="StoredProcedure\heartbeatServer.js">
<DependentUpon>heartbeatServer.ts</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="StoredProcedure\setJobParameter.js">
<DependentUpon>setJobParameter.ts</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="StoredProcedure\setJobState.js">
<DependentUpon>setJobState.ts</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="StoredProcedure\persistDocuments.js">
<DependentUpon>persistDocuments.ts</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="StoredProcedure\expireDocuments.js">
<DependentUpon>expireDocuments.ts</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="StoredProcedure\deleteDocuments.js">
<DependentUpon>deleteDocuments.ts</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="StoredProcedure\upsertDocuments.js">
<DependentUpon>upsertDocuments.ts</DependentUpon>
</EmbeddedResource>
<None Include="StoredProcedure\document.js">
<DependentUpon>document.ts</DependentUpon>
</None>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Hangfire.Core" Version="1.6.21" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="Microsoft.Azure.DocumentDB.Core" Version="2.2.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
<PackageReference Include="Microsoft.Azure.DocumentDB" Version="2.2.0" />
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net461;netstandard2.0</TargetFrameworks>
<ProductName>Hangfire.AzureDocumentDB</ProductName>
<Title>Hangfire.AzureDocumentDB</Title>
<Company>Hangfire.AzureDocumentDB</Company>
<Authors>Imran Momin</Authors>
<PackageLicense>https://github.com/imranmomin/hangfire.azuredocumentdb/blob/master/LICENSE</PackageLicense>
<PackageProjectUrl>https://github.com/imranmomin/hangfire.azuredocumentdb</PackageProjectUrl>
<Copyright>Copyright 2018</Copyright>
<PackageTags>Hangfire Azure DocumentDB Cosmos</PackageTags>
<Description>This package adds support to Microsoft Azure DocumentDB for Hangfire</Description>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<PackageVersion>1.0.1</PackageVersion>
<Version>2.0.0</Version>
<FileVersion>2.0.0.0</FileVersion>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<RootNamespace>Hangfire.Azure</RootNamespace>
<TypeScriptToolsVersion>Latest</TypeScriptToolsVersion>
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<DefineConstants>NETCORE;NETSTANDARD;NETSTANDARD2_0</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net461'">
<DefineConstants>NET461;NETFULL</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net461|AnyCPU'">
<DocumentationFile>bin\Release\net461\Hangfire.AzureDocumentDB.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|netstandard2.0|AnyCPU'">
<DocumentationFile>bin\Release\netstandard2.0\Hangfire.AzureDocumentDB.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<None Remove="node_modules\**" />
<None Remove="package-lock.json" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="StoredProcedure\heartbeatServer.js">
<DependentUpon>heartbeatServer.ts</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="StoredProcedure\setJobParameter.js">
<DependentUpon>setJobParameter.ts</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="StoredProcedure\setJobState.js">
<DependentUpon>setJobState.ts</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="StoredProcedure\persistDocuments.js">
<DependentUpon>persistDocuments.ts</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="StoredProcedure\expireDocuments.js">
<DependentUpon>expireDocuments.ts</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="StoredProcedure\deleteDocuments.js">
<DependentUpon>deleteDocuments.ts</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="StoredProcedure\upsertDocuments.js">
<DependentUpon>upsertDocuments.ts</DependentUpon>
</EmbeddedResource>
<None Include="StoredProcedure\document.js">
<DependentUpon>document.ts</DependentUpon>
</None>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Hangfire.Core" Version="1.7.3" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="Microsoft.Azure.DocumentDB.Core" Version="2.4.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
<PackageReference Include="Microsoft.Azure.DocumentDB" Version="2.4.0" />
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion Hangfire.AzureDocumentDB/Queue/JobQueue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public IFetchedJob Dequeue(string[] queues, CancellationToken cancellationToken)
string query = $"SELECT TOP 1 * FROM doc WHERE doc.type = @type AND doc.name IN ({string.Join(", ", queueParams)}) " +
"AND (NOT IS_DEFINED(doc.fetched_at) OR doc.fetched_at < @timeout) ORDER BY doc.created_on";

List<SqlParameter> parameters = new List<SqlParameter> { new SqlParameter("@type", Documents.DocumentTypes.Queue) };
List<SqlParameter> parameters = new List<SqlParameter> { new SqlParameter("@type", (int)Documents.DocumentTypes.Queue) };
for (int index = 0; index < queues.Length; index++)
{
string queue = queues[index];
Expand Down
Loading

0 comments on commit a292947

Please sign in to comment.