小编Sam*_*Sam的帖子

Bull 单独的进程超时,“作业停滞超过允许的限制”

我正在尝试将 Bull 实现到我的 TypeScript 项目中。我有以下代码:

索引.ts

import Bull, {
    Queue
} from 'bull';

void(async function() {
    const monitorQueue: Bull.Queue < any > = new Bull(`stock`, {
        redis: {
            port: 1234,
            host: 'xxxxx',
            password: 'xxxxx'
        }
    });
    monitorQueue.on('error', err => {
        console.error(err);
    });
    monitorQueue.on('failed', async function(job, error) {
        console.log(error);
    });
    monitorQueue.on('completed', async function(job, error) {
        console.log(error);
    });

    Promise.all([
        monitorQueue.add({
            foo: 'bar1'
        }),
        monitorQueue.add({
            foo: 'bar2'
        }),
        monitorQueue.add({
            foo: 'bar3'
        }),
        monitorQueue.add({
            foo: 'bar4'
        })
    ]).then(() => {
        monitorQueue.process(4, 'C:/Users/Documents/src/processor.js');
    })
})(); …
Run Code Online (Sandbox Code Playgroud)

node.js typescript

7
推荐指数
0
解决办法
3474
查看次数

复制病毒文件导致我的程序终止

我已经制作了一个可以将文件从源复制到目标的工具。但是,在复制过程中,该软件遇到了由反病毒软件(Symantec)标记的病毒。

然后,该防病毒软件导致我的软件关闭,并将该程序隔离为“滴管”。

无论如何,我是否可以优雅地处理这种情况,而不是完全关闭程序?

我知道此操作是反病毒程序的结果,但是我能做些什么来帮助解决这种情况?例如,Robocopy不仅会在遇到病毒时终止。

这是我的复制代码;

void CopyFileExactly(CopyParameterBundle cpb, bool overwrite)
{

    string CTP = "", CFP = "";
    CFP = cpb.SourcePath;

    if (cpb.RenameFile)
        CTP = cpb.DestPath ;
    else
        CTP = cpb.DestPath;

    //Check firstly if the file to copy exists
    if (!File.Exists(CFP))
    {
        throw new FileNotFoundException();
    }

    //Check if destination file exists
    //If it does, make it not read only so we can update MAC times
    if (File.Exists(CTP))
    {
        var target = GetFile(CTP);//new FileInfo(CTP);
        if (target.IsReadOnly)
            target.IsReadOnly = false;
    }

    var …
Run Code Online (Sandbox Code Playgroud)

c#

5
推荐指数
1
解决办法
144
查看次数

无法确定 C.free 的名称类型

C.free我正在尝试在我的 Golang 应用程序中使用。我的代码如下:

package main

import (
    "fmt"
    "unsafe"
)

// #include <stdlib.h>

import (
    "C"
)


//export FreeMemory
func FreeMemory(pointer *int64) {
    C.free(unsafe.Pointer(pointer))
}
Run Code Online (Sandbox Code Playgroud)

我做了一些搜索,我知道错误是因为我没有stdlib.h包含,但我包含。

这是我的构建命令:go build --buildmode=c-shared -o main.dll. 构建后出现的错误是:could not determine kind of name for C.free

我的操作系统是 Windows 10

谢谢

go

5
推荐指数
1
解决办法
9351
查看次数

将字符串列表投影到SQL语句列表中

我有一个字符串列表: List<string> NameList = new List<string>()

名称列表包含以下项目: John Doe,Tom Jones,Bob Sinclair

我想将这些项目投影到一个单独的连接字符串,如下所示:

isnull(piv.[John Doe],0) [John Doe],
isnull(piv.[Tom Jones],0) [Tom Jones],
isnull(piv.[Bob Sinclair],0) [Bob Sinclair]
Run Code Online (Sandbox Code Playgroud)

以上是一个SQL语句,将使用我正在制作的程序构建.我不需要执行SQL,只需将连接的名称列表以上述格式返回为字符串.

c#

2
推荐指数
2
解决办法
78
查看次数

将字节数组转换为十六进制字符串

我正在尝试将以下字节数组转换为十六进制;

[1, 1, 65, -50, 6, 104, -91, -70, -100, 119, -100, 123, 52, -109, -33, 45, -14, 86, -105, -97, -115, 16]
Run Code Online (Sandbox Code Playgroud)

结果应该是;

010141CE0668A5BA9C779C7B3493DF2DF256979F8D10
Run Code Online (Sandbox Code Playgroud)

这是我目前的尝试;

item.getProperties["Mapi-Conversation-Index"].to_a.map {|s| s.to_s(16)}.join()
Run Code Online (Sandbox Code Playgroud)

但是我的输出是: 010141-320668-5b-46-6477-647b34-6d-212d-e56-69-61-7310

ruby

1
推荐指数
2
解决办法
1957
查看次数

#的未定义方法'gsub'

运行脚本时,我不断收到此错误。我对Ruby很陌生,所以请原谅。

我正在使用内置了JRuby支持的Nuix编写脚本。

这是我的代码;

require 'benchmark'
require 'socket'
require 'rubygems'
require 'java'

java_import org.joda.time.format.DateTimeFormat

    module JSwing
      include_package javax.swing
    end

    def dropdown()

        ar = Array.new

        $current_case.getRootItems().each do set
        ar  set.guid()
        end

        names2 = JSwingJOptionPane.showInputDialog(nil, Please enter the name of the item set to export to Relativity., 
                                                            Choose item set, -1, 
                                                            nil, ar.to_java(Object), ar[0])
        if (names2.nil)
        JSwingJOptionPane.showMessageDialog(nil, No Export Set Selected)
            abort()
            end
        return names2
    end

    def writeLine (filepath, line)
        File.open(filepath, 'a') { f1 f1.puts line }
    end 

    def writeLines(filepath, lines)

        #lines.each do …
Run Code Online (Sandbox Code Playgroud)

ruby java jruby

0
推荐指数
1
解决办法
1073
查看次数

更新 ObjectListView 中的项目

我正在ObjectListView我的应用程序中使用该控件。每隔 1 秒,我就有一个计时器滴答作响,并刷新( )List类型。我的班级是这样的;TransferMetricsList<TransferMetrics> activeTransfersTransferMetrics

class TransferMetrics
{
    public Guid guid { get; set; }
    public string jobName {get; set;}
    public int TotalTransferred {get; set;}
    public int TotalToTransfer { get; set; }
    public int TotalFailed { get; set; }
    public DateTime TimeStarted { get; set; }
    public string status { get; set; }

    //Used for single file uploads only
    public double percentage { get; set; }
    public int cps { get; set; } …
Run Code Online (Sandbox Code Playgroud)

c# objectlistview

0
推荐指数
1
解决办法
2651
查看次数

标签 统计

c# ×3

ruby ×2

go ×1

java ×1

jruby ×1

node.js ×1

objectlistview ×1

typescript ×1