Implemented Queues and folder monitors.
This commit is contained in:
@@ -48,31 +48,51 @@ namespace BodyshopUploader.ViewModels
|
||||
Properties.Settings.Default.Save();
|
||||
}
|
||||
|
||||
public void StartAllFolderMonitors()
|
||||
{
|
||||
if (FolderMonitors.Count > 0)
|
||||
foreach (var m in FolderMonitors)
|
||||
{
|
||||
m.Dispose();
|
||||
}
|
||||
|
||||
foreach (var p in MonitoringPaths)
|
||||
{
|
||||
//Ensure the directory exists, then start monitoring for CIECA files.
|
||||
System.IO.Directory.CreateDirectory(p);
|
||||
FolderMonitors.Add(new Utils.CIECAMonitor(p));
|
||||
}
|
||||
}
|
||||
|
||||
public void StopAllFolderMonitors()
|
||||
{
|
||||
if (FolderMonitors.Count > 0)
|
||||
foreach (var m in FolderMonitors)
|
||||
{
|
||||
m.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
public async Task TestGql()
|
||||
{
|
||||
if (MonitoringPaths == null) MonitoringPaths = new ObservableCollection<string>();
|
||||
MonitoringPaths.Add(@"C:\IMEX");
|
||||
Properties.Settings.Default.MonitoringPaths = MonitoringPaths;
|
||||
Properties.Settings.Default.Save();
|
||||
var r = new GraphQLRequest
|
||||
{
|
||||
Query = @"
|
||||
query {
|
||||
jobs {
|
||||
id
|
||||
est_number
|
||||
ro_number
|
||||
}
|
||||
}
|
||||
"
|
||||
};
|
||||
|
||||
//var r = new GraphQLRequest
|
||||
//{
|
||||
// Query = @"
|
||||
// query {
|
||||
// jobs {
|
||||
// id
|
||||
// est_number
|
||||
// ro_number
|
||||
// }
|
||||
// }
|
||||
// "
|
||||
//};
|
||||
|
||||
//using (var g = Utils.GraphQL.CreateGQLClient())
|
||||
//{
|
||||
// var graphQLResponse = await g.PostAsync(r);
|
||||
// logger.Info(graphQLResponse.Data.jobs);
|
||||
//}
|
||||
using (var g = Utils.GraphQL.CreateGQLClient())
|
||||
{
|
||||
var graphQLResponse = await g.PostAsync(r);
|
||||
logger.Info(graphQLResponse.Data.jobs);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user